Fix setLocalStorage call before websocket connection

This commit is contained in:
shortcutme 2018-11-21 03:32:12 +01:00
parent 4195a72621
commit 06fbcde815
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 15 additions and 10 deletions

View file

@ -380,6 +380,7 @@ class Wrapper
actionSetLocalStorage: (message) -> actionSetLocalStorage: (message) ->
$.when(@event_site_info).done =>
back = localStorage.setItem "site.#{@site_info.address}.#{@site_info.auth_address}", JSON.stringify(message.params) back = localStorage.setItem "site.#{@site_info.address}.#{@site_info.auth_address}", JSON.stringify(message.params)
@sendInner {"cmd": "response", "to": message.id, "result": back} @sendInner {"cmd": "response", "to": message.id, "result": back}

View file

@ -540,7 +540,6 @@ $.extend( $.easing,
}).call(this); }).call(this);
/* ---- src/Ui/media/Loading.coffee ---- */ /* ---- src/Ui/media/Loading.coffee ---- */
@ -1384,14 +1383,18 @@ $.extend( $.easing,
}; };
Wrapper.prototype.actionSetLocalStorage = function(message) { Wrapper.prototype.actionSetLocalStorage = function(message) {
return $.when(this.event_site_info).done((function(_this) {
return function() {
var back; var back;
back = localStorage.setItem("site." + this.site_info.address + "." + this.site_info.auth_address, JSON.stringify(message.params)); back = localStorage.setItem("site." + _this.site_info.address + "." + _this.site_info.auth_address, JSON.stringify(message.params));
return this.sendInner({ return _this.sendInner({
"cmd": "response", "cmd": "response",
"to": message.id, "to": message.id,
"result": back "result": back
}); });
}; };
})(this));
};
Wrapper.prototype.onOpenWebsocket = function(e) { Wrapper.prototype.onOpenWebsocket = function(e) {
if (window.show_loadingscreen) { if (window.show_loadingscreen) {
@ -1688,6 +1691,7 @@ $.extend( $.easing,
}).call(this); }).call(this);
/* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */ /* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */