-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add environment check to Remote-Config Module #3623
Conversation
🦋 Changeset detectedLatest commit: d11c83d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
packages/remote-config/index.ts
Outdated
* 2. check if the current browser context is valid for using IndexedDB. | ||
* | ||
*/ | ||
async function isSupported(): Promise<boolean> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking (no action req'd): the change to registerRemoteConfig
will throw if IndexedDB is unavailable, in which case we'd need a method to call prior to registration, which is why isSupported
is static, ie:
import * as remoteconfig from 'firebase/remote-config';
import * as firebase from 'firebase/app';
if (remoteconfig.isSupported()) {
const rc = firebase.remoteconfig();
...
}
Changeset File Check ✅
|
packages/firebase/index.d.ts
Outdated
@@ -1772,6 +1772,15 @@ declare namespace firebase.remoteConfig { | |||
* Defines levels of Remote Config logging. | |||
*/ | |||
export type LogLevel = 'debug' | 'error' | 'silent'; | |||
/** | |||
* Returns true if current browser context supports initialization of remote config module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egilmorez Can you please take a look at it?
Sorry, this should go away if you pull master now, or you can just ignore it. |
f053094
to
d11c83d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, thanks!
I've rebased and updated this since it was last updated a year ago. |
Issue 2393 fix for Remote-Config module.
Added
isSupported
method where users can call to check if indexedDB is supported before initializing the module.Fixes #5502