diff --git a/react/features/prejoin/components/Prejoin.js b/react/features/prejoin/components/Prejoin.js index 9c83bcefd..f93285530 100644 --- a/react/features/prejoin/components/Prejoin.js +++ b/react/features/prejoin/components/Prejoin.js @@ -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) }; diff --git a/react/features/prejoin/functions.js b/react/features/prejoin/functions.js index 511429e4c..febffeafe 100644 --- a/react/features/prejoin/functions.js +++ b/react/features/prejoin/functions.js @@ -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. *