Skip to content

Commit 6986b31

Browse files
committed
Fix logic of enabling analytics in test lab
We were only enabling analytics when running the device in the test lab. No wonder all the metrics were so strange!
1 parent 4149725 commit 6986b31

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/app.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ class JournalApp extends StatelessWidget {
8383
JournalApp.isInDebugMode = true;
8484
}
8585

86-
bool should = (JournalApp.isInDebugMode == false);
87-
should = should && (await runtime_env.inFirebaseTestLab());
86+
bool inFireBaseTestLab = await runtime_env.inFirebaseTestLab();
87+
bool enabled = !JournalApp.isInDebugMode && !inFireBaseTestLab;
8888

89-
Fimber.d("Analytics Collection: $should");
90-
JournalApp.analytics.setAnalyticsCollectionEnabled(should);
89+
Fimber.d("Analytics Collection: $enabled");
90+
JournalApp.analytics.setAnalyticsCollectionEnabled(enabled);
9191

92-
if (should) {
92+
if (enabled) {
9393
JournalApp.analytics.logEvent(
9494
name: "settings",
9595
parameters: Settings.instance.toLoggableMap(),

0 commit comments

Comments
 (0)