1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Add an IndexedDB existence check to the crypto store

This will be useful for future storage diagnostics as part of
https://github.com/vector-im/riot-web/issues/9271.
This commit is contained in:
J. Ryan Stinnett
2019-03-25 15:33:28 +00:00
parent eadec35093
commit 8513f5c413

View File

@@ -22,6 +22,7 @@ import LocalStorageCryptoStore from './localStorage-crypto-store';
import MemoryCryptoStore from './memory-crypto-store'; import MemoryCryptoStore from './memory-crypto-store';
import * as IndexedDBCryptoStoreBackend from './indexeddb-crypto-store-backend'; import * as IndexedDBCryptoStoreBackend from './indexeddb-crypto-store-backend';
import {InvalidCryptoStoreError} from '../../errors'; import {InvalidCryptoStoreError} from '../../errors';
import * as IndexedDBHelpers from "../../indexeddb-helpers";
/** /**
* Internal module. indexeddb storage for e2e. * Internal module. indexeddb storage for e2e.
@@ -48,6 +49,10 @@ export default class IndexedDBCryptoStore {
this._backendPromise = null; this._backendPromise = null;
} }
static exists(indexedDB, dbName) {
return IndexedDBHelpers.exists(indexedDB, dbName);
}
/** /**
* Ensure the database exists and is up-to-date, or fall back to * Ensure the database exists and is up-to-date, or fall back to
* a local storage or in-memory store. * a local storage or in-memory store.