Fix setLocalStorage call before websocket connection
This commit is contained in:
parent
4195a72621
commit
06fbcde815
2 changed files with 15 additions and 10 deletions
|
@ -380,8 +380,9 @@ class Wrapper
|
||||||
|
|
||||||
|
|
||||||
actionSetLocalStorage: (message) ->
|
actionSetLocalStorage: (message) ->
|
||||||
back = localStorage.setItem "site.#{@site_info.address}.#{@site_info.auth_address}", JSON.stringify(message.params)
|
$.when(@event_site_info).done =>
|
||||||
@sendInner {"cmd": "response", "to": message.id, "result": back}
|
back = localStorage.setItem "site.#{@site_info.address}.#{@site_info.auth_address}", JSON.stringify(message.params)
|
||||||
|
@sendInner {"cmd": "response", "to": message.id, "result": back}
|
||||||
|
|
||||||
|
|
||||||
# EOF actions
|
# EOF actions
|
||||||
|
|
|
@ -540,7 +540,6 @@ $.extend( $.easing,
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ---- src/Ui/media/Loading.coffee ---- */
|
/* ---- src/Ui/media/Loading.coffee ---- */
|
||||||
|
|
||||||
|
|
||||||
|
@ -1384,13 +1383,17 @@ $.extend( $.easing,
|
||||||
};
|
};
|
||||||
|
|
||||||
Wrapper.prototype.actionSetLocalStorage = function(message) {
|
Wrapper.prototype.actionSetLocalStorage = function(message) {
|
||||||
var back;
|
return $.when(this.event_site_info).done((function(_this) {
|
||||||
back = localStorage.setItem("site." + this.site_info.address + "." + this.site_info.auth_address, JSON.stringify(message.params));
|
return function() {
|
||||||
return this.sendInner({
|
var back;
|
||||||
"cmd": "response",
|
back = localStorage.setItem("site." + _this.site_info.address + "." + _this.site_info.auth_address, JSON.stringify(message.params));
|
||||||
"to": message.id,
|
return _this.sendInner({
|
||||||
"result": back
|
"cmd": "response",
|
||||||
});
|
"to": message.id,
|
||||||
|
"result": back
|
||||||
|
});
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
Wrapper.prototype.onOpenWebsocket = function(e) {
|
Wrapper.prototype.onOpenWebsocket = function(e) {
|
||||||
|
@ -1688,6 +1691,7 @@ $.extend( $.easing,
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */
|
/* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue