Merge pull request #1092 from jitsi/update-lock-state

Updates lock state
This commit is contained in:
yanas 2016-10-31 17:29:11 -05:00 committed by GitHub
commit a5e7c86125
2 changed files with 12 additions and 10 deletions

View File

@ -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();

View File

@ -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();