Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat: make display name prompt platform independent

Bettenbuk Zoltanc1598b737666
diff --git a/conference.js b/conference.js
index 59e25abda1..1a74a65c54 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 e9b2df0653..97cdb8d976 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 83c1ed6563..8024646d13 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;
}