We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41ed6f2 commit 211a6cfCopy full SHA for 211a6cf
packages/util/src/environment.ts
@@ -136,14 +136,11 @@ export function isSafari(): boolean {
136
}
137
138
/**
139
- * This method checks if indexedDB is supported by current browser
140
- * @return true if indexedDB is supported by current browser
+ * This method checks if indexedDB is supported by current browser/service worker context
+ * @return true if indexedDB is supported by current browser/service worker context
141
*/
142
export function isIndexedDBAvailable(): boolean {
143
- if (!('indexedDB' in window) || indexedDB === null) {
144
- return false;
145
- }
146
- return true;
+ return 'indexedDB' in self && indexedDB !== null;
147
148
149
0 commit comments