Bugfix. onConnected overrides need to return promise.

This commit is contained in:
JC Brand 2016-03-16 10:10:35 +00:00
parent bf9929b1e3
commit 5651f76373
2 changed files with 7 additions and 3 deletions

View File

@ -44,7 +44,7 @@
converse.minimized_chats = new converse.MinimizedChats({
model: converse.chatboxes
});
this._super.onConnected.apply(this, arguments);
return this._super.onConnected.apply(this, arguments);
},
registerGlobalEventHandlers: function () {

View File

@ -32,12 +32,16 @@
// New functions which don't exist yet can also be added.
onConnected: function () {
this._super.onConnected().done(converse.registerPingHandler);
var promise = this._super.onConnected();
promise.done(converse.registerPingHandler);
return promise;
},
onReconnected: function () {
// We need to re-register the ping event handler on the newly
// created connection.
this._super.onReconnected().done(converse.registerPingHandler);
var promise = this._super.onReconnected();
promise.done(converse.registerPingHandler);
return promise;
}
},