Procházet zdrojové kódy

ref(settings): remove changeLocalDisplayName action

factor2
Hristo Terezov před 1 rokem
rodič
revize
88b6cdf39b

+ 2
- 2
modules/API/API.js Zobrazit soubor

@@ -41,6 +41,7 @@ import {
41 41
 import { LOCAL_PARTICIPANT_DEFAULT_ID } from '../../react/features/base/participants/constants';
42 42
 import {
43 43
     getLocalParticipant,
44
+    getNormalizedDisplayName,
44 45
     getParticipantById,
45 46
     getScreenshareParticipantIds,
46 47
     getVirtualScreenshareParticipantByOwnerId,
@@ -105,7 +106,6 @@ import { startAudioScreenShareFlow, startScreenShareFlow } from '../../react/fea
105 106
 import { isScreenAudioSupported } from '../../react/features/screen-share/functions';
106 107
 import { toggleScreenshotCaptureSummary } from '../../react/features/screenshot-capture/actions';
107 108
 import { isScreenshotCaptureEnabled } from '../../react/features/screenshot-capture/functions';
108
-import { changeLocalDisplayName } from '../../react/features/settings/actions.web';
109 109
 import SettingsDialog from '../../react/features/settings/components/web/SettingsDialog';
110 110
 import { SETTINGS_TABS } from '../../react/features/settings/constants';
111 111
 import { playSharedVideo, stopSharedVideo } from '../../react/features/shared-video/actions.any';
@@ -201,7 +201,7 @@ function initCommands() {
201 201
         },
202 202
         'display-name': displayName => {
203 203
             sendAnalytics(createApiEvent('display.name.changed'));
204
-            APP.store.dispatch(changeLocalDisplayName(displayName));
204
+            APP.store.dispatch(updateSettings({ displayName: getNormalizedDisplayName(displayName) }));
205 205
         },
206 206
         'local-subject': localSubject => {
207 207
             sendAnalytics(createApiEvent('local.subject.changed'));

+ 0
- 13
react/features/settings/actions.native.ts Zobrazit soubor

@@ -36,16 +36,3 @@ export function openLogoutDialog() {
36 36
         }));
37 37
     };
38 38
 }
39
-
40
-/**
41
-* Changes the display name for the local user.
42
-*
43
-* @param {string} _nickname - The new display name.
44
-* @returns {Function}
45
-*/
46
-export function changeLocalDisplayName(_nickname = '') {
47
-    // not used on mobile.
48
-    return (_dispatch: IStore['dispatch'], _getState: IStore['getState']) => {
49
-        // no-op action.
50
-    };
51
-}

+ 1
- 15
react/features/settings/actions.web.ts Zobrazit soubor

@@ -192,7 +192,7 @@ export function submitProfileTab(newState: any) {
192 192
         const currentState = getProfileTabProps(getState());
193 193
 
194 194
         if (newState.displayName !== currentState.displayName) {
195
-            dispatch(changeLocalDisplayName(newState.displayName));
195
+            dispatch(updateSettings({ displayName: getNormalizedDisplayName(newState.displayName) }));
196 196
         }
197 197
 
198 198
         if (newState.email !== currentState.email) {
@@ -201,20 +201,6 @@ export function submitProfileTab(newState: any) {
201 201
     };
202 202
 }
203 203
 
204
-/**
205
-* Changes the display name for the local user.
206
-*
207
-* @param {string} nickname - The new display name.
208
-* @returns {Function}
209
-*/
210
-export function changeLocalDisplayName(nickname = '') {
211
-    return (dispatch: IStore['dispatch']) => {
212
-        const formattedNickname = getNormalizedDisplayName(nickname);
213
-
214
-        dispatch(updateSettings({ displayName: formattedNickname }));
215
-    };
216
-}
217
-
218 204
 /**
219 205
  * Submits the settings from the "Sounds" tab of the settings dialog.
220 206
  *

Načítá se…
Zrušit
Uložit