1
0
mirror of https://github.com/GitJournal/GitJournal.git synced 2025-07-25 11:57:18 +08:00

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!
This commit is contained in:
Vishesh Handa
2020-01-04 14:28:56 +01:00
parent 4149725017
commit 6986b314ff

@ -83,13 +83,13 @@ class JournalApp extends StatelessWidget {
JournalApp.isInDebugMode = true;
}
bool should = (JournalApp.isInDebugMode == false);
should = should && (await runtime_env.inFirebaseTestLab());
bool inFireBaseTestLab = await runtime_env.inFirebaseTestLab();
bool enabled = !JournalApp.isInDebugMode && !inFireBaseTestLab;
Fimber.d("Analytics Collection: $should");
JournalApp.analytics.setAnalyticsCollectionEnabled(should);
Fimber.d("Analytics Collection: $enabled");
JournalApp.analytics.setAnalyticsCollectionEnabled(enabled);
if (should) {
if (enabled) {
JournalApp.analytics.logEvent(
name: "settings",
parameters: Settings.instance.toLoggableMap(),