Skip to content

Commit 8914722

Browse files
committed
addressed PR comments
1 parent a25263d commit 8914722

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/firebase/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ declare namespace firebase.remoteConfig {
17731773
*/
17741774
export type LogLevel = 'debug' | 'error' | 'silent';
17751775
/**
1776-
* An async function that returns true if current browser context supports initialization of remote config module
1776+
* Returns true if current browser context supports initialization of remote config module
17771777
* (`firebase.remoteConfig()`).
17781778
*
17791779
* Returns false otherwise.

packages/remote-config/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function registerRemoteConfig(
7777
}
7878
// Guards against the SDK being used when indexedDB is not available.
7979
if (!isIndexedDBAvailable()) {
80-
throw ERROR_FACTORY.create(ErrorCode.INDEXED_DB_UNSUPPORTED);
80+
throw ERROR_FACTORY.create(ErrorCode.INDEXED_DB_UNAVAILABLE);
8181
}
8282
// Normalizes optional inputs.
8383
const { projectId, apiKey, appId } = app.options;
@@ -159,8 +159,7 @@ async function isSupported(): Promise<boolean> {
159159
}
160160

161161
try {
162-
const isDBOpenable: boolean = await validateIndexedDBOpenable();
163-
return isDBOpenable;
162+
return await validateIndexedDBOpenable();
164163
} catch (error) {
165164
return false;
166165
}

packages/remote-config/src/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const enum ErrorCode {
3131
FETCH_THROTTLE = 'fetch-throttle',
3232
FETCH_PARSE = 'fetch-client-parse',
3333
FETCH_STATUS = 'fetch-status',
34-
INDEXED_DB_UNSUPPORTED = 'indexed-db-unsupported'
34+
INDEXED_DB_UNAVAILABLE = 'indexed-db-unavailable'
3535
}
3636

3737
const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {
@@ -66,7 +66,7 @@ const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {
6666
' Original error: {$originalErrorMessage}.',
6767
[ErrorCode.FETCH_STATUS]:
6868
'Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.',
69-
[ErrorCode.INDEXED_DB_UNSUPPORTED]:
69+
[ErrorCode.INDEXED_DB_UNAVAILABLE]:
7070
'Indexed DB is not supported by current browser'
7171
};
7272

0 commit comments

Comments
 (0)