Merge pull request #872 from jryans/storage-existence-check-ls-crypto

Add existence check to local storage based crypto store
This commit is contained in:
J. Ryan Stinnett
2019-03-28 17:49:08 +00:00
committed by GitHub
@@ -57,6 +57,16 @@ export default class LocalStorageCryptoStore extends MemoryCryptoStore {
this.store = webStore;
}
static exists(webStore) {
const length = webStore.length;
for (let i = 0; i < length; i++) {
if (webStore.key(i).startsWith(E2E_PREFIX)) {
return true;
}
}
return false;
}
// Olm Sessions
countEndToEndSessions(txn, func) {