Commit 852942c
authored
Improve firebase initialization logic
Add check to prevent fatal error on script reload.
In Firebase V9 Compat, if firebase.initializeApp() is called twice (which can happen if a mobile browser aggressively caches and re-executes the script, or if you hot-reload your local server), Firebase throws a fatal internal error: "Firebase App named '[DEFAULT]' already exists." While our silent catch block would hide this error from the participant, it's methodologically safer to prevent the error from firing at all.1 parent 25648b6 commit 852942c
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
0 commit comments