2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-16 20:25:26 +00:00

Simplify DSN file (#475)

* Add checks for empty sentry DSN

* Add default DSN key

* Fix CI workflows
This commit is contained in:
Oliver
2024-03-06 21:09:06 +11:00
committed by GitHub
parent a889c4adbe
commit b02dc5bac7
8 changed files with 25 additions and 16 deletions

View File

@ -6,6 +6,7 @@ import "package:package_info_plus/package_info_plus.dart";
import "package:sentry_flutter/sentry_flutter.dart";
import "package:inventree/api.dart";
import "package:inventree/dsn.dart";
import "package:inventree/preferences.dart";
Future<Map<String, dynamic>> getDeviceInfo() async {
@ -85,6 +86,10 @@ bool isInDebugMode() {
Future<bool> sentryReportMessage(String message, {Map<String, String>? context}) async {
if (SENTRY_DSN_KEY.isEmpty) {
return false;
}
final server_info = getServerInfo();
final app_info = await getAppInfo();
final device_info = await getDeviceInfo();
@ -164,6 +169,10 @@ Future<void> sentryReportError(String source, dynamic error, StackTrace? stackTr
return;
}
if (SENTRY_DSN_KEY.isEmpty) {
return;
}
final upload = await InvenTreeSettingsManager().getValue(INV_REPORT_ERRORS, true) as bool;
if (!upload) {