mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Explicitly create cryptoStore
in React SDK
The React SDK has a client creation path that starts 2 out of 3 stores, but then leaves the other one for the JS SDK's default value handling. We'll soon be adding additional code to check the health of stores, so it would be simpler to follow and think about if we create them all in one place.
This commit is contained in:
parent
ed72352636
commit
2ac7dd4ca3
1 changed files with 10 additions and 4 deletions
|
@ -48,10 +48,6 @@ export default function createMatrixClient(opts, useIndexedDb) {
|
|||
useAuthorizationHeader: true,
|
||||
};
|
||||
|
||||
if (localStorage) {
|
||||
storeOpts.sessionStore = new Matrix.WebStorageSessionStore(localStorage);
|
||||
}
|
||||
|
||||
if (indexedDB && localStorage && useIndexedDb) {
|
||||
storeOpts.store = new Matrix.IndexedDBStore({
|
||||
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);
|
||||
|
||||
return Matrix.createClient(opts);
|
||||
|
|
Loading…
Reference in a new issue