From dadcc519b798b49fc20936c0bca37a9372c0b84f Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 16 Aug 2019 11:33:57 +0200 Subject: [PATCH] lint compliance --- www/common/outer/async-store.js | 9 ++++--- www/common/toolbar3.js | 43 +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index fb1bcd202..012b5bec5 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1170,9 +1170,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]; @@ -1181,7 +1178,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 d6b116df3..c44144fe9 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -574,6 +574,49 @@ MessengerUI, Messages) { return $shareBlock; }; + var createRequest = function (toolbar, config) { + if (!config.metadataMgr) { + throw new Error("You must provide a `metadataMgr` to display the request access button"); + } + + // We can only requets more access if we're in read-only mode + if (config.readOnly !== 1) { return; } + + var $requestBlock = $('