From c4a90a90f209d4ba2cce5c9281efd09cd7ad959a Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 16 Aug 2019 11:33:57 +0200 Subject: [PATCH] Fix disconnection event not propagating to the UI --- www/common/outer/async-store.js | 9 +++++---- www/common/toolbar3.js | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index e793cbcb3..6b7942d13 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1188,9 +1188,6 @@ define([ onLeave: function (m) { channel.bcast("PAD_LEAVE", m); }, - onAbort: function () { - channel.bcast("PAD_DISCONNECT"); - }, onError: function (err) { channel.bcast("PAD_ERROR", err); delete channels[data.channel]; @@ -1199,7 +1196,11 @@ define([ channel.bcast("PAD_ERROR", err); delete channels[data.channel]; }, - onConnectionChange: function () {}, + onConnectionChange: function (info) { + if (!info.state) { + channel.bcast("PAD_DISCONNECT"); + } + }, crypto: { // The encryption and decryption is done in the outer window. // This async-store only deals with already encrypted messages. diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 6c262e2d1..a2547d223 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -575,7 +575,6 @@ MessengerUI, Messages) { }; var createRequest = function (toolbar, config) { - console.error('test'); if (!config.metadataMgr) { throw new Error("You must provide a `metadataMgr` to display the request access button"); }