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