Selaa lähdekoodia

ref(settings): remove changeLocalDisplayName action

factor2
Hristo Terezov 1 vuosi sitten
vanhempi
commit
88b6cdf39b

+ 2
- 2
modules/API/API.js Näytä tiedosto

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

+ 0
- 13
react/features/settings/actions.native.ts Näytä tiedosto

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 Näytä tiedosto

192
         const currentState = getProfileTabProps(getState());
192
         const currentState = getProfileTabProps(getState());
193
 
193
 
194
         if (newState.displayName !== currentState.displayName) {
194
         if (newState.displayName !== currentState.displayName) {
195
-            dispatch(changeLocalDisplayName(newState.displayName));
195
+            dispatch(updateSettings({ displayName: getNormalizedDisplayName(newState.displayName) }));
196
         }
196
         }
197
 
197
 
198
         if (newState.email !== currentState.email) {
198
         if (newState.email !== currentState.email) {
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
  * Submits the settings from the "Sounds" tab of the settings dialog.
205
  * Submits the settings from the "Sounds" tab of the settings dialog.
220
  *
206
  *

Loading…
Peruuta
Tallenna