Browse Source

Reverted indexedDButils

develop
Ezerous 4 years ago
parent
commit
d2c056ce2c
  1. 23
      packages/concordia-app/src/utils/indexedDB/indexedDBUtils.js

23
packages/concordia-app/src/utils/indexedDB/indexedDBUtils.js

@ -5,24 +5,17 @@ const purgeIndexedDBs = async () => {
if (orbit) await orbit.stop(); if (orbit) await orbit.stop();
if (ipfs) await ipfs.stop(); if (ipfs) await ipfs.stop();
const databases = await indexedDB.databases();
return Promise const databases = await indexedDB.databases();
.all(databases return Promise.all(
.filter((database) => database.name !== 'level-js-ethprovider/identities') databases.map((db) => new Promise(
.map((database) => new Promise((resolve, reject) => { (resolve, reject) => {
const request = indexedDB.deleteDatabase(database.name); const request = indexedDB.deleteDatabase(db.name);
request.onblocked = () => {
Promise.all([
orbit && orbit.stop ? orbit.stop() : Promise.resolve(),
ipfs && ipfs.stop ? ipfs.stop() : Promise.resolve(),
]).catch((reason) => {
console.log(reason);
});
};
request.onsuccess = resolve; request.onsuccess = resolve;
request.onerror = reject; request.onerror = reject;
}))); },
)),
);
}; };
export default purgeIndexedDBs; export default purgeIndexedDBs;

Loading…
Cancel
Save