InitDB: add missing objectStores
InitDB now automatically adds the missing objectstore instead of rejecting
This commit is contained in:
parent
1954fc0782
commit
38f43d805d
@ -8401,8 +8401,12 @@ Bitcoin.Util = {
|
|||||||
.stringify(Object.keys(
|
.stringify(Object.keys(
|
||||||
objectStores).sort()))
|
objectStores).sort()))
|
||||||
resolve("Initiated IndexedDB");
|
resolve("Initiated IndexedDB");
|
||||||
else
|
else {
|
||||||
reject("IndexedDB already exist with different ObjectStores!");
|
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();
|
db.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user