mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
fix : LocalStorageService deserialization
This commit is contained in:
parent
bd99027852
commit
5693f34fb9
@ -36,7 +36,7 @@
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ns.LocalStorageService.prototype.persistToLocalStorage_ = function() {
|
ns.LocalStorageService.prototype.persistToLocalStorage_ = function() {
|
||||||
|
|
||||||
console.log('[LocalStorage service]: Snapshot stored');
|
console.log('[LocalStorage service]: Snapshot stored');
|
||||||
window.localStorage.snapShot = this.piskelController.serialize();
|
window.localStorage.snapShot = this.piskelController.serialize();
|
||||||
};
|
};
|
||||||
@ -45,9 +45,9 @@
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ns.LocalStorageService.prototype.restoreFromLocalStorage_ = function() {
|
ns.LocalStorageService.prototype.restoreFromLocalStorage_ = function() {
|
||||||
|
var framesheet = JSON.parse(window.localStorage.snapShot);
|
||||||
this.piskelController.deserialize(window.localStorage.snapShot);
|
var piskel = pskl.utils.Serializer.createPiskel(framesheet);
|
||||||
this.piskelController.setCurrentFrameIndex(0);
|
pskl.app.piskelController.setPiskel(piskel);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user