Clarify Sentry code
This commit is contained in:
parent
d00d5c8745
commit
244019329e
|
|
@ -1,5 +1,4 @@
|
|||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.enableR8=true
|
||||
android.enableDexingArtifactTransform=false
|
||||
android.enableR8=true
|
||||
|
|
@ -96,17 +96,22 @@ void main({bool isTesting = false}) async {
|
|||
options.dsn = Config.SENTRY_DNS;
|
||||
options.release = kClientVersion;
|
||||
options.beforeSend = (SentryEvent event, {dynamic hint}) {
|
||||
if (!(store.state.account?.reportErrors ?? false)) {
|
||||
final state = store.state;
|
||||
final account = state.account;
|
||||
final reportErrors = account?.reportErrors ?? false;
|
||||
|
||||
if (!reportErrors) {
|
||||
return null;
|
||||
}
|
||||
|
||||
event = event.copyWith(
|
||||
environment: '${store.state.environment}'.split('.').last,
|
||||
extra: <String, dynamic>{
|
||||
'server_version':
|
||||
store.state.account?.currentVersion ?? 'Unknown',
|
||||
'route': store.state.uiState.currentRoute,
|
||||
'server_version': account?.currentVersion ?? 'Unknown',
|
||||
'route': state.uiState.currentRoute,
|
||||
},
|
||||
);
|
||||
|
||||
return event;
|
||||
};
|
||||
},
|
||||
|
|
|
|||
10
pubspec.lock
10
pubspec.lock
|
|
@ -760,7 +760,7 @@ packages:
|
|||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.2"
|
||||
version: "1.10.0-nullsafety.3"
|
||||
permission_handler:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -802,7 +802,7 @@ packages:
|
|||
name: pool
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.0-nullsafety.2"
|
||||
version: "1.5.0-nullsafety.3"
|
||||
process:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -968,14 +968,14 @@ packages:
|
|||
name: source_map_stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.4"
|
||||
source_maps:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_maps
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.10-nullsafety.2"
|
||||
version: "0.10.10-nullsafety.3"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1229,5 +1229,5 @@ packages:
|
|||
source: hosted
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.12.0-0.0 <=2.12.0-133.0.dev"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.22.2 <2.0.0"
|
||||
|
|
|
|||
Loading…
Reference in New Issue