1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-21 16:55:10 -05:00

IndexedDB error

This commit is contained in:
Sébastien Hut 2015-10-26 19:35:33 +01:00
parent ef91e2b2a7
commit 2c6af7111b
2 changed files with 8 additions and 3 deletions

View File

@ -50,7 +50,10 @@ module.exports = {
app.desktop = new Desktop();
app.cache = new AppCache();
app.storage = new Storage();
app.storage.open(function() {
app.storage.open(function(success) {
if (!success) {
console.error('IndexedDB is not activated (private mode?)');
}
cb();
});
},

View File

@ -30,7 +30,7 @@ Storage.prototype = {
var request = indexedDB.open('datastorage', this.version);
request.onsuccess = function (e) {
self.db = e.target.result;
cb(false, self.db);
cb(true);
};
request.onupgradeneeded = function (e) {
var db = e.target.result;
@ -40,7 +40,9 @@ Storage.prototype = {
self.archive.setup(db);
self.profiles.setup(db);
};
request.onerror = cb;
request.onerror = function(e) {
cb(false);
};
}
};