You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Add support for using indexeddb in a webworker
This commit is contained in:
@@ -50,6 +50,18 @@ class MatrixClientPeg {
|
|||||||
this.opts = {
|
this.opts = {
|
||||||
initialSyncLimit: 20,
|
initialSyncLimit: 20,
|
||||||
};
|
};
|
||||||
|
this.indexedDbWorkerScript = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the script href passed to the IndexedDB web worker
|
||||||
|
* If set, a separate web worker will be started to run the IndexedDB
|
||||||
|
* queries on.
|
||||||
|
*
|
||||||
|
* @param {string} script href to the script to be passed to the web worker
|
||||||
|
*/
|
||||||
|
setIndexedDbWorkerScript(script) {
|
||||||
|
this.indexedDbWorkerScript = script;
|
||||||
}
|
}
|
||||||
|
|
||||||
get(): MatrixClient {
|
get(): MatrixClient {
|
||||||
@@ -129,6 +141,7 @@ class MatrixClientPeg {
|
|||||||
indexedDB: window.indexedDB,
|
indexedDB: window.indexedDB,
|
||||||
dbName: "riot-web-sync",
|
dbName: "riot-web-sync",
|
||||||
localStorage: localStorage,
|
localStorage: localStorage,
|
||||||
|
workerScript: this.indexedDbWorkerScript,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user