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 committed by vp8x8
parent c74bdf137c
commit 23b8dd4860
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 React, { Component } from 'react';
import { getRoomName } from '../../base/conference'; import { getRoomName } from '../../base/conference';
import { isNameReadOnly } from '../../base/config';
import { translate } from '../../base/i18n'; import { translate } from '../../base/i18n';
import { IconArrowDown, IconArrowUp, IconPhone, IconVolumeOff } from '../../base/icons'; import { IconArrowDown, IconArrowUp, IconPhone, IconVolumeOff } from '../../base/icons';
import { isVideoMutedByUser } from '../../base/media'; import { isVideoMutedByUser } from '../../base/media';
@ -21,7 +20,8 @@ import {
isDeviceStatusVisible, isDeviceStatusVisible,
isDisplayNameRequired, isDisplayNameRequired,
isJoinByPhoneButtonVisible, isJoinByPhoneButtonVisible,
isJoinByPhoneDialogVisible isJoinByPhoneDialogVisible,
isPrejoinNameReadOnly
} from '../functions'; } from '../functions';
import DropdownButton from './DropdownButton'; import DropdownButton from './DropdownButton';
@ -388,7 +388,7 @@ function mapStateToProps(state): Object {
showDialog: isJoinByPhoneDialogVisible(state), showDialog: isJoinByPhoneDialogVisible(state),
showErrorOnJoin, showErrorOnJoin,
hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state), hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
readOnlyName: isNameReadOnly(state), readOnlyName: isPrejoinNameReadOnly(state),
showCameraPreview: !isVideoMutedByUser(state), showCameraPreview: !isVideoMutedByUser(state),
videoTrack: getLocalJitsiVideoTrack(state) videoTrack: getLocalJitsiVideoTrack(state)
}; };

View File

@ -36,6 +36,16 @@ export function isDisplayNameRequired(state: Object): boolean {
|| state['features/base/config'].requireDisplayName; || 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. * Selector for determining if the user has chosen to skip prejoin page.
* *