Skip to content

Commit

Permalink
fix(core): Defensively catch Firebase isSupported calls (#3146)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels authored Feb 7, 2022
1 parent f61bc7d commit 520930b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ const isMessagingSupportedPromiseSymbol = '__angularfire_symbol__messagingIsSupp

globalThis[isAnalyticsSupportedPromiseSymbol] ||= isAnalyticsSupported().then(it =>
globalThis[isAnalyticsSupportedValueSymbol] = it
).catch(() =>
globalThis[isAnalyticsSupportedValueSymbol] = false
);

globalThis[isMessagingSupportedPromiseSymbol] ||= isMessagingSupported().then(it =>
globalThis[isMessagingSupportedValueSymbol] = it
).catch(() =>
globalThis[isMessagingSupportedValueSymbol] = false
);

globalThis[isRemoteConfigSupportedPromiseSymbol] ||= isRemoteConfigSupported().then(it =>
globalThis[isRemoteConfigSupportedValueSymbol] = it
).catch(() =>
globalThis[isRemoteConfigSupportedValueSymbol] = false
);

const isSupportedError = (module: string) =>
Expand Down

0 comments on commit 520930b

Please sign in to comment.