InitDB: add missing objectStores

InitDB now automatically adds the missing objectstore instead of rejecting
This commit is contained in:
sairajzero 2020-05-02 18:10:47 +05:30
parent 1954fc0782
commit 38f43d805d

View File

@ -8401,8 +8401,12 @@ Bitcoin.Util = {
.stringify(Object.keys(
objectStores).sort()))
resolve("Initiated IndexedDB");
else
reject("IndexedDB already exist with different ObjectStores!");
else {
Object.values(db.objectStoreNames).forEach(obs => delete objectStores[obs])
this.initDB(dbName, objectStores, db.version + 1)
.then(result => resolve(result))
.catch(error => reject(error))
}
db.close();
}
});