mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Return promise results from PiskelDB and IndexedDBStorageService
This commit is contained in:
parent
407b432227
commit
5ecf351e0f
@ -29,9 +29,7 @@
|
||||
return _requestPromise(request).then(function (event) {
|
||||
this.db = event.target.result;
|
||||
return this.db;
|
||||
}.bind(this)).catch(function (e) {
|
||||
console.log('Failed to initialize IndexedDB, local browser saves will be unavailable.');
|
||||
});
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
ns.PiskelDatabase.prototype.onUpgradeNeeded_ = function (event) {
|
||||
|
@ -7,7 +7,9 @@
|
||||
};
|
||||
|
||||
ns.IndexedDbStorageService.prototype.init = function () {
|
||||
this.piskelDatabase.init();
|
||||
this.piskelDatabase.init().catch(function (e) {
|
||||
console.log('Failed to initialize PiskelDatabase, local browser saves will be unavailable.');
|
||||
});
|
||||
};
|
||||
|
||||
ns.IndexedDbStorageService.prototype.save = function (piskel) {
|
||||
@ -30,7 +32,7 @@
|
||||
};
|
||||
|
||||
ns.IndexedDbStorageService.prototype.load = function (name) {
|
||||
this.piskelDatabase.get(name).then(function (piskelData) {
|
||||
return this.piskelDatabase.get(name).then(function (piskelData) {
|
||||
if (typeof piskelData !== 'undefined') {
|
||||
var serialized = piskelData.serialized;
|
||||
pskl.utils.serialization.Deserializer.deserialize(
|
||||
@ -46,7 +48,7 @@
|
||||
};
|
||||
|
||||
ns.IndexedDbStorageService.prototype.remove = function (name) {
|
||||
this.piskelDatabase.delete(name);
|
||||
return this.piskelDatabase.delete(name);
|
||||
};
|
||||
|
||||
ns.IndexedDbStorageService.prototype.getKeys = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user