You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-07 23:02:56 +03:00
Fix fallback to MemoryCryptoStore when LocalStorage unavailable (#4797)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e3a3a52f2a
commit
1ba4412260
@@ -204,9 +204,12 @@ export class IndexedDBCryptoStore implements CryptoStore {
|
|||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (!(globalThis.localStorage instanceof Storage)) {
|
||||||
|
throw new Error("localStorage is not available");
|
||||||
|
}
|
||||||
return new LocalStorageCryptoStore(globalThis.localStorage);
|
return new LocalStorageCryptoStore(globalThis.localStorage);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.warn(`unable to open localStorage: falling back to in-memory store: ${e}`);
|
logger.warn(`Unable to open localStorage: falling back to in-memory store: ${e}`);
|
||||||
return new MemoryCryptoStore();
|
return new MemoryCryptoStore();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user