diff --git a/modules/UI/invite/Invite.js b/modules/UI/invite/Invite.js index 23ebd79ef..289df0251 100644 --- a/modules/UI/invite/Invite.js +++ b/modules/UI/invite/Invite.js @@ -40,9 +40,9 @@ class Invite { this.conference.on(ConferenceEvents.USER_ROLE_CHANGED, (id) => { if (APP.conference.isLocalId(id) - && this.isModerator !== this.conference.isModerator) { + && this.isModerator !== this.conference.isModerator()) { - this.setModerator(this.conference.isModerator); + this.setModerator(this.conference.isModerator()); } }); @@ -116,7 +116,6 @@ class Invite { * creating view object using as a model this module */ initDialog() { - this.password = this.getPassword(); this.view = new InviteDialogView(this); } @@ -191,10 +190,8 @@ class Invite { * @param isLocked */ setLockedFromElsewhere(isLocked) { - // isLocked can be 1, true or false - let newLockState = (isLocked === 1) || isLocked; let oldLockState = this.roomLocker.isLocked; - if (oldLockState !== newLockState) { + if (oldLockState !== isLocked) { this.roomLocker.lockedElsewhere = isLocked; APP.UI.emitEvent(UIEvents.TOGGLE_ROOM_LOCK); this.updateView(); diff --git a/modules/UI/invite/InviteDialogView.js b/modules/UI/invite/InviteDialogView.js index 95ee622b6..2919ee22f 100644 --- a/modules/UI/invite/InviteDialogView.js +++ b/modules/UI/invite/InviteDialogView.js @@ -177,7 +177,8 @@ export default class InviteDialogView { * @returns {string} */ getPasswordBlock() { - let { password, isModerator } = this.model; + let password = this.model.getPassword(); + let { isModerator } = this.model; if (isModerator) { return (` @@ -321,13 +322,17 @@ export default class InviteDialogView { */ updateView() { let pass = this.model.getPassword(); - if (this.model.getRoomLocker().lockedElsewhere || !pass) + let { isModerator } = this.model; + if (this.model.getRoomLocker().lockedElsewhere || !pass) { $('#inviteDialogPassword').attr("data-i18n", "passwordSetRemotely"); - else + APP.translation.translateElement($('#inviteDialogPassword')); + } else { + $('#inviteDialogPassword').removeAttr("data-i18n"); $('#inviteDialogPassword').text(pass); + } // if we are not moderator we cannot remove password - if (APP.conference.isModerator) + if (isModerator) $('#inviteDialogRemovePassword').show(); else $('#inviteDialogRemovePassword').hide();