create missing idb store
This commit is contained in:
parent
30af48a69a
commit
97520be9b2
|
@ -127,9 +127,11 @@ const db = (() => {
|
|||
}
|
||||
|
||||
function create(event) {
|
||||
if (event.oldVersion === 0) {
|
||||
const idb = event.target.result;
|
||||
idb.createObjectStore(getStoreName(idb.name), ID_AS_KEY[idb.name] ? {
|
||||
/** @type IDBDatabase */
|
||||
const idb = event.target.result;
|
||||
const sn = getStoreName(idb.name);
|
||||
if (!idb.objectStoreNames.contains(sn)) {
|
||||
idb.createObjectStore(sn, ID_AS_KEY[idb.name] ? {
|
||||
keyPath: 'id',
|
||||
autoIncrement: true,
|
||||
} : undefined);
|
||||
|
|
Loading…
Reference in New Issue
Block a user