From 5651f76373e492447b78d6c86f63eaeaf72cdd5e Mon Sep 17 00:00:00 2001 From: JC Brand Date: Wed, 16 Mar 2016 10:10:35 +0000 Subject: [PATCH] Bugfix. onConnected overrides need to return promise. --- src/converse-minimize.js | 2 +- src/converse-ping.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/converse-minimize.js b/src/converse-minimize.js index 02ade1065..e02c12628 100644 --- a/src/converse-minimize.js +++ b/src/converse-minimize.js @@ -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 () { diff --git a/src/converse-ping.js b/src/converse-ping.js index 2fcbc7d72..e69a63053 100644 --- a/src/converse-ping.js +++ b/src/converse-ping.js @@ -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; } },