diff --git a/src/module/Application/pwa/js/WordRotatorDb.js b/src/module/Application/pwa/js/WordRotatorDb.js index 1bd1367..04fe4c2 100755 --- a/src/module/Application/pwa/js/WordRotatorDb.js +++ b/src/module/Application/pwa/js/WordRotatorDb.js @@ -11,7 +11,7 @@ export class WordRotatorDb extends MyDb { } constructor() { - super("wordRotator", 4); + super("wordRotator", 5); } upgrade(db, oldVersion, newVersion, e) { @@ -30,8 +30,10 @@ export class WordRotatorDb extends MyDb { levelObjectStore.createIndex("difficulty", "difficulty", {"unique": false}); } - if (Helper.isNull(oldVersion) || oldVersion < 3 && newVersion >= 4) { - let levelObjectStore = db.createObjectStore(WordRotatorDb.OBJECT_STORE.SYSTEM_VARS, {"keyPath": "name"}); + if (Helper.isNull(oldVersion) || oldVersion < 5 && newVersion >= 5) { + if (!e.target.transaction.objectStore(WordRotatorDb.OBJECT_STORE.LEVEL)){ + let levelObjectStore = db.createObjectStore(WordRotatorDb.OBJECT_STORE.SYSTEM_VARS, {"keyPath": "name"}); + } } };