From fe9b89257aeb17bc9bc35fa9588e203d25fd938b Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 4 Feb 2021 23:11:40 +0100 Subject: [PATCH] Set buttons visibility when disconnecting. --- static/galene.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/galene.js b/static/galene.js index a95bcc7..f97bedc 100644 --- a/static/galene.js +++ b/static/galene.js @@ -424,6 +424,7 @@ function setVisibility(id, visible) { } function setButtonsVisibility() { + let connected = serverConnection && serverConnection.socket; let permissions = serverConnection.permissions; let local = !!findUpMedia('local'); let share = !!findUpMedia('screenshare'); @@ -438,7 +439,7 @@ function setButtonsVisibility() { setVisibility('presentbutton', permissions.present && !local); setVisibility('unpresentbutton', local); - setVisibility('mutebutton', permissions.present); + setVisibility('mutebutton', !connected || permissions.present); // allow multiple shared documents setVisibility('sharebutton', permissions.present && @@ -1768,6 +1769,7 @@ async function gotJoined(kind, group, perms, message) { case 'fail': displayError('The server said: ' + message); this.close(); + setButtonsVisibility(); return; case 'redirect': this.close(); @@ -1775,6 +1777,7 @@ async function gotJoined(kind, group, perms, message) { return; case 'leave': this.close(); + setButtonsVisibility(); return; case 'join': case 'change':