From bf8c9650e04dd7ea902040aa7ce36adf678a981e Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Mon, 7 Jan 2019 18:52:44 -0500 Subject: [PATCH] Messed up the migration, I think? --- audio.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/audio.js b/audio.js index 90344dc..919ce10 100644 --- a/audio.js +++ b/audio.js @@ -199,7 +199,7 @@ function loadRemoteAudio(name) { // check if the content is cached function checkCache(type, name, hit, miss) { - const req = window.indexedDB.open("cache", 2); + const req = window.indexedDB.open("cache", 3); req.onsuccess = () => { const db = req.result; const tx = db.transaction([type], "readonly"); @@ -249,7 +249,7 @@ function initAudio(story, state) { // caching stuff here function storeCache(type, name, blob) { - const req = window.indexedDB.open("cache", 2); + const req = window.indexedDB.open("cache", 3); req.onsuccess = () => { const db = req.result; const tx = db.transaction([type], "readwrite"); @@ -272,12 +272,12 @@ function storeCache(type, name, blob) { function createCache() { let idb = window.indexedDB; - let req = idb.open("cache", 2); + let req = idb.open("cache", 3); req.onupgradeneeded = event => { const db = event.target.result; - if (event.oldVersion == 1) { + if (event.oldVersion > 0 && event.oldVersion < 3) { db.deleteObjectStore("audio"); }