Skip to content

Commit

Permalink
fix(Prejoin): Make prejoin name noneditable only when taken from jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
vp8x8 committed Nov 15, 2021
1 parent 9290d9f commit af7c316
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions react/features/prejoin/components/Prejoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -21,7 +20,8 @@ import {
isDeviceStatusVisible,
isDisplayNameRequired,
isJoinByPhoneButtonVisible,
isJoinByPhoneDialogVisible
isJoinByPhoneDialogVisible,
isPrejoinNameReadOnly
} from '../functions';

import JoinByPhoneDialog from './dialogs/JoinByPhoneDialog';
Expand Down Expand Up @@ -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)
};
Expand Down
10 changes: 10 additions & 0 deletions react/features/prejoin/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit af7c316

Please sign in to comment.