You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-01 04:43:29 +03:00
Add feature detection for webworkers
Only use web worker store if we have web workers available
This commit is contained in:
@@ -82,7 +82,7 @@ const IndexedDBStore = function IndexedDBStore(opts) {
|
||||
throw new Error('Missing required option: indexedDB');
|
||||
}
|
||||
|
||||
if (opts.workerScript) {
|
||||
if (opts.workerScript && window.Worker) {
|
||||
this.backend = new RemoteIndexedDBStoreBackend(opts.workerScript, opts.dbName);
|
||||
} else {
|
||||
this.backend = new LocalIndexedDBStoreBackend(opts.indexedDB, opts.dbName);
|
||||
|
||||
Reference in New Issue
Block a user