From 7aa47647f08e487365541ab10921e32dcbbd3376 Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 15 Jul 2016 15:40:18 -0500 Subject: [PATCH] Avoids multiple dialog when showing lock attempt errors. --- modules/UI/authentication/RoomLocker.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/UI/authentication/RoomLocker.js b/modules/UI/authentication/RoomLocker.js index 09e29a31b..838074496 100644 --- a/modules/UI/authentication/RoomLocker.js +++ b/modules/UI/authentication/RoomLocker.js @@ -116,6 +116,7 @@ const ConferenceErrors = JitsiMeetJS.errors.conference; */ export default function createRoomLocker (room) { let password; + let dialog = null; function lock (newPass) { return room.lock(newPass).then(function () { @@ -196,12 +197,21 @@ export default function createRoomLocker (room) { * Show notification that to set/remove password user must be moderator. */ notifyModeratorRequired () { + if (dialog) + return; + + let closeCallback = function () { + dialog = null; + }; + if (password) { - APP.UI.messageHandler - .openMessageDialog(null, "dialog.passwordError"); + dialog = APP.UI.messageHandler + .openMessageDialog(null, "dialog.passwordError", + null, null, closeCallback); } else { - APP.UI.messageHandler - .openMessageDialog(null, "dialog.passwordError2"); + dialog = APP.UI.messageHandler + .openMessageDialog(null, "dialog.passwordError2", + null, null, closeCallback); } } };