Просмотр исходного кода

Messed up the migration, I think?

tags/v0.1.0
Fen Dweller 7 лет назад
Родитель
Сommit
bf8c9650e0
1 измененных файлов: 4 добавлений и 4 удалений
  1. +4
    -4
      audio.js

+ 4
- 4
audio.js Просмотреть файл

@@ -199,7 +199,7 @@ function loadRemoteAudio(name) {


// check if the content is cached // check if the content is cached
function checkCache(type, name, hit, miss) { function checkCache(type, name, hit, miss) {
const req = window.indexedDB.open("cache", 2);
const req = window.indexedDB.open("cache", 3);
req.onsuccess = () => { req.onsuccess = () => {
const db = req.result; const db = req.result;
const tx = db.transaction([type], "readonly"); const tx = db.transaction([type], "readonly");
@@ -249,7 +249,7 @@ function initAudio(story, state) {
// caching stuff here // caching stuff here


function storeCache(type, name, blob) { function storeCache(type, name, blob) {
const req = window.indexedDB.open("cache", 2);
const req = window.indexedDB.open("cache", 3);
req.onsuccess = () => { req.onsuccess = () => {
const db = req.result; const db = req.result;
const tx = db.transaction([type], "readwrite"); const tx = db.transaction([type], "readwrite");
@@ -272,12 +272,12 @@ function storeCache(type, name, blob) {
function createCache() { function createCache() {
let idb = window.indexedDB; let idb = window.indexedDB;


let req = idb.open("cache", 2);
let req = idb.open("cache", 3);


req.onupgradeneeded = event => { req.onupgradeneeded = event => {
const db = event.target.result; const db = event.target.result;


if (event.oldVersion == 1) {
if (event.oldVersion > 0 && event.oldVersion < 3) {
db.deleteObjectStore("audio"); db.deleteObjectStore("audio");
} }




Загрузка…
Отмена
Сохранить