Skip to content

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

ref(settings): remove changeLocalDisplayName action

Hristo Terezov88b6cdf39b2c
diff --git a/modules/API/API.js b/modules/API/API.js
index fd6671b9aa..40872dd585 100644
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -41,6 +41,7 @@ import {
import { LOCAL_PARTICIPANT_DEFAULT_ID } from '../../react/features/base/participants/constants';
import {
getLocalParticipant,
+ getNormalizedDisplayName,
getParticipantById,
getScreenshareParticipantIds,
getVirtualScreenshareParticipantByOwnerId,
@@ -105,7 +106,6 @@ import { startAudioScreenShareFlow, startScreenShareFlow } from '../../react/fea
import { isScreenAudioSupported } from '../../react/features/screen-share/functions';
import { toggleScreenshotCaptureSummary } from '../../react/features/screenshot-capture/actions';
import { isScreenshotCaptureEnabled } from '../../react/features/screenshot-capture/functions';
-import { changeLocalDisplayName } from '../../react/features/settings/actions.web';
import SettingsDialog from '../../react/features/settings/components/web/SettingsDialog';
import { SETTINGS_TABS } from '../../react/features/settings/constants';
import { playSharedVideo, stopSharedVideo } from '../../react/features/shared-video/actions.any';
@@ -201,7 +201,7 @@ function initCommands() {
},
'display-name': displayName => {
sendAnalytics(createApiEvent('display.name.changed'));
- APP.store.dispatch(changeLocalDisplayName(displayName));
+ APP.store.dispatch(updateSettings({ displayName: getNormalizedDisplayName(displayName) }));
},
'local-subject': localSubject => {
sendAnalytics(createApiEvent('local.subject.changed'));
diff --git a/react/features/settings/actions.native.ts b/react/features/settings/actions.native.ts
index 7cee33eddd..fe6c149cb9 100644
--- a/react/features/settings/actions.native.ts
+++ b/react/features/settings/actions.native.ts
@@ -36,16 +36,3 @@ export function openLogoutDialog() {
}));
};
}
-
-/**
-* Changes the display name for the local user.
-*
-* @param {string} _nickname - The new display name.
-* @returns {Function}
-*/
-export function changeLocalDisplayName(_nickname = '') {
- // not used on mobile.
- return (_dispatch: IStore['dispatch'], _getState: IStore['getState']) => {
- // no-op action.
- };
-}
diff --git a/react/features/settings/actions.web.ts b/react/features/settings/actions.web.ts
index a85a59f975..bcc5a5d200 100644
--- a/react/features/settings/actions.web.ts
+++ b/react/features/settings/actions.web.ts
@@ -192,7 +192,7 @@ export function submitProfileTab(newState: any) {
const currentState = getProfileTabProps(getState());
if (newState.displayName !== currentState.displayName) {
- dispatch(changeLocalDisplayName(newState.displayName));
+ dispatch(updateSettings({ displayName: getNormalizedDisplayName(newState.displayName) }));
}
if (newState.email !== currentState.email) {
@@ -201,20 +201,6 @@ export function submitProfileTab(newState: any) {
};
}
-/**
-* Changes the display name for the local user.
-*
-* @param {string} nickname - The new display name.
-* @returns {Function}
-*/
-export function changeLocalDisplayName(nickname = '') {
- return (dispatch: IStore['dispatch']) => {
- const formattedNickname = getNormalizedDisplayName(nickname);
-
- dispatch(updateSettings({ displayName: formattedNickname }));
- };
-}
-
/**
* Submits the settings from the "Sounds" tab of the settings dialog.
*