1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-23 00:55:58 +01:00

Set buttons visibility when disconnecting.

This commit is contained in:
Juliusz Chroboczek 2021-02-04 23:11:40 +01:00
parent 0ce509c62c
commit fe9b89257a

View file

@ -424,6 +424,7 @@ function setVisibility(id, visible) {
} }
function setButtonsVisibility() { function setButtonsVisibility() {
let connected = serverConnection && serverConnection.socket;
let permissions = serverConnection.permissions; let permissions = serverConnection.permissions;
let local = !!findUpMedia('local'); let local = !!findUpMedia('local');
let share = !!findUpMedia('screenshare'); let share = !!findUpMedia('screenshare');
@ -438,7 +439,7 @@ function setButtonsVisibility() {
setVisibility('presentbutton', permissions.present && !local); setVisibility('presentbutton', permissions.present && !local);
setVisibility('unpresentbutton', local); setVisibility('unpresentbutton', local);
setVisibility('mutebutton', permissions.present); setVisibility('mutebutton', !connected || permissions.present);
// allow multiple shared documents // allow multiple shared documents
setVisibility('sharebutton', permissions.present && setVisibility('sharebutton', permissions.present &&
@ -1768,6 +1769,7 @@ async function gotJoined(kind, group, perms, message) {
case 'fail': case 'fail':
displayError('The server said: ' + message); displayError('The server said: ' + message);
this.close(); this.close();
setButtonsVisibility();
return; return;
case 'redirect': case 'redirect':
this.close(); this.close();
@ -1775,6 +1777,7 @@ async function gotJoined(kind, group, perms, message) {
return; return;
case 'leave': case 'leave':
this.close(); this.close();
setButtonsVisibility();
return; return;
case 'join': case 'join':
case 'change': case 'change':