mirror of https://github.com/vector-im/riot-web
Merge pull request #2814 from jryans/storage-edge-cases
Explicitly create `cryptoStore` in React SDKpull/21833/head
commit
140e0d6a30
|
@ -48,10 +48,6 @@ export default function createMatrixClient(opts, useIndexedDb) {
|
||||||
useAuthorizationHeader: true,
|
useAuthorizationHeader: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (localStorage) {
|
|
||||||
storeOpts.sessionStore = new Matrix.WebStorageSessionStore(localStorage);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (indexedDB && localStorage && useIndexedDb) {
|
if (indexedDB && localStorage && useIndexedDb) {
|
||||||
storeOpts.store = new Matrix.IndexedDBStore({
|
storeOpts.store = new Matrix.IndexedDBStore({
|
||||||
indexedDB: indexedDB,
|
indexedDB: indexedDB,
|
||||||
|
@ -61,6 +57,16 @@ export default function createMatrixClient(opts, useIndexedDb) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (localStorage) {
|
||||||
|
storeOpts.sessionStore = new Matrix.WebStorageSessionStore(localStorage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (indexedDB && useIndexedDb) {
|
||||||
|
storeOpts.cryptoStore = new Matrix.IndexedDBCryptoStore(
|
||||||
|
indexedDB, "matrix-js-sdk:crypto",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
opts = Object.assign(storeOpts, opts);
|
opts = Object.assign(storeOpts, opts);
|
||||||
|
|
||||||
return Matrix.createClient(opts);
|
return Matrix.createClient(opts);
|
||||||
|
|
Loading…
Reference in New Issue