diff --git a/conference.js b/conference.js index 59e25abda..1a74a65c5 100644 --- a/conference.js +++ b/conference.js @@ -2200,12 +2200,6 @@ export default { APP.keyboardshortcut.init(); - if (config.requireDisplayName - && !APP.conference.getLocalDisplayName() - && !room.isHidden()) { - APP.UI.promptDisplayName(); - } - APP.store.dispatch(conferenceJoined(room)); const displayName diff --git a/modules/UI/UI.js b/modules/UI/UI.js index e9b2df065..97cdb8d97 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -15,7 +15,6 @@ import Filmstrip from './videolayout/Filmstrip'; import { getLocalParticipant } from '../../react/features/base/participants'; import { toggleChat } from '../../react/features/chat'; -import { openDisplayNamePrompt } from '../../react/features/display-name'; import { setEtherpadHasInitialzied } from '../../react/features/etherpad'; import { setFilmstripVisible } from '../../react/features/filmstrip'; import { setNotificationsEnabled } from '../../react/features/notifications'; @@ -549,13 +548,6 @@ UI.handleLastNEndpoints = function(leavingIds, enteringIds) { VideoLayout.onLastNEndpointsChanged(leavingIds, enteringIds); }; -/** - * Prompt user for nickname. - */ -UI.promptDisplayName = () => { - APP.store.dispatch(openDisplayNamePrompt(undefined)); -}; - /** * Update audio level visualization for specified user. * @param {string} id user id diff --git a/react/features/base/conference/middleware.js b/react/features/base/conference/middleware.js index 83c1ed656..8024646d1 100644 --- a/react/features/base/conference/middleware.js +++ b/react/features/base/conference/middleware.js @@ -1,6 +1,8 @@ // @flow import { reloadNow } from '../../app'; +import { openDisplayNamePrompt } from '../../display-name'; + import { ACTION_PINNED, ACTION_UNPINNED, @@ -12,6 +14,7 @@ import { import { CONNECTION_ESTABLISHED, CONNECTION_FAILED } from '../connection'; import { JitsiConferenceErrors } from '../lib-jitsi-meet'; import { + getLocalParticipant, getParticipantById, getPinnedParticipant, PARTICIPANT_UPDATED, @@ -186,6 +189,7 @@ function _conferenceJoined({ dispatch, getState }, next, action) { const result = next(action); const { conference } = action; const { pendingSubjectChange } = getState()['features/base/conference']; + const { requireDisplayName } = getState()['features/base/config']; pendingSubjectChange && dispatch(setSubject(pendingSubjectChange)); @@ -199,6 +203,12 @@ function _conferenceJoined({ dispatch, getState }, next, action) { }; window.addEventListener('beforeunload', beforeUnloadHandler); + if (requireDisplayName + && !getLocalParticipant(getState)?.name + && !conference.isHidden()) { + dispatch(openDisplayNamePrompt(undefined)); + } + return result; }