fix(Prejoin): Make prejoin name noneditable only when taken from jwt

This commit is contained in:
Vlad Piersec 2021-11-15 13:11:39 +02:00
parent 9290d9fec0
commit af7c316827
2 changed files with 13 additions and 3 deletions

View File

@ -4,7 +4,6 @@ import InlineDialog from '@atlaskit/inline-dialog';
import React, { Component } from 'react';
import { getRoomName } from '../../base/conference';
import { isNameReadOnly } from '../../base/config';
import { translate } from '../../base/i18n';
import { Icon, IconArrowDown, IconArrowUp, IconPhone, IconVolumeOff } from '../../base/icons';
import { isVideoMutedByUser } from '../../base/media';
@ -21,7 +20,8 @@ import {
isDeviceStatusVisible,
isDisplayNameRequired,
isJoinByPhoneButtonVisible,
isJoinByPhoneDialogVisible
isJoinByPhoneDialogVisible,
isPrejoinNameReadOnly
} from '../functions';
import JoinByPhoneDialog from './dialogs/JoinByPhoneDialog';
@ -401,7 +401,7 @@ function mapStateToProps(state): Object {
showDialog: isJoinByPhoneDialogVisible(state),
showErrorOnJoin,
hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
readOnlyName: isNameReadOnly(state),
readOnlyName: isPrejoinNameReadOnly(state),
showCameraPreview: !isVideoMutedByUser(state),
videoTrack: getLocalJitsiVideoTrack(state)
};

View File

@ -36,6 +36,16 @@ export function isDisplayNameRequired(state: Object): boolean {
|| state['features/base/config'].requireDisplayName;
}
/**
* Selector for determining if the display name from prejoin page is read only.
*
* @param {Object} state - The state of the app.
* @returns {boolean}
*/
export function isPrejoinNameReadOnly(state: Object): boolean {
return Boolean(state['features/base/jwt']?.user?.name);
}
/**
* Selector for determining if the user has chosen to skip prejoin page.
*