ref(settings): remove changeLocalDisplayName action

This commit is contained in:
Hristo Terezov
2024-04-19 13:18:46 -05:00
parent e3ab6c9f33
commit 88b6cdf39b
3 changed files with 3 additions and 30 deletions

View File

@@ -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'));

View File

@@ -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.
};
}

View File

@@ -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.
*