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:
10
lib/app.dart
10
lib/app.dart
@ -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(),
|
||||
|
Reference in New Issue
Block a user