Skip to content

Commit

Permalink
fix: Ignore duplicate errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Jan 31, 2024
1 parent d0238d6 commit a4657ac
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/katana_firebase/lib/firebase/firebase_core.dart
Expand Up @@ -94,7 +94,15 @@ class FirebaseCore {
_completer = Completer();
try {
FirebaseCore.region = region;
_app = await Firebase.initializeApp(options: options);
try {
_app = await Firebase.initializeApp(options: options);
} on FirebaseException catch (e) {
if (e.code == "duplicate-app") {
_app = Firebase.app();
} else {
rethrow;
}
}
if (!kIsWeb) {
FirebaseFirestore.instance.settings = const Settings();
}
Expand Down

0 comments on commit a4657ac

Please sign in to comment.