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

Close the DB right away

This seems to be needed in Chrome to avoid blocking future opens.
This commit is contained in:
J. Ryan Stinnett
2019-03-26 14:58:45 +00:00
parent c1ba5de686
commit 49a7defbf0

View File

@@ -35,6 +35,8 @@ export function exists(indexedDB, dbName) {
};
req.onblocked = () => reject();
req.onsuccess = () => {
const db = req.result;
db.close();
if (!exists) {
// The DB did not exist before, but has been created as part of this
// existence check. Delete it now to restore previous state. Delete can