File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -79,11 +79,16 @@ Future<List<CosHubPost>> getCosHubPosts(Ref ref) async {
7979}
8080
8181//TODO: reset ID when disabled
82+ bool didInitFirebase = false ;
8283Future <void > configurePushNotifications () async {
83- // Required before doing anything with firebase
84- await Firebase .initializeApp (
85- options: DefaultFirebaseOptions .currentPlatform,
86- );
84+ if (! didInitFirebase) {
85+ // Required before doing anything with firebase
86+ await Firebase .initializeApp (
87+ options: DefaultFirebaseOptions .currentPlatform,
88+ );
89+ didInitFirebase = true ;
90+ }
91+
8792 //Disable firebase and clear ID
8893 if (! HiveProxy .getOrDefault (settings, marketingNotificationsEnabled, defaultValue: marketingNotificationsEnabledDefault) ||
8994 HiveProxy .getOrDefault (settings, hasCompletedOnboarding, defaultValue: hasCompletedOnboardingDefault) != hasCompletedOnboardingVersionToAgree) {
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ Future<void> main() async {
152152
153153 initFlutter ();
154154 await initHive ();
155- await configurePushNotifications ();
155+ configurePushNotifications ();
156156 initMainApp ();
157157}
158158
You can’t perform that action at this time.
0 commit comments