[FIX]Update profile name (#4513)
This commit is contained in:
parent
101a137a35
commit
661b3f9a22
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export interface IProfileParams {
|
export interface IProfileParams {
|
||||||
name: string;
|
realname?: string;
|
||||||
|
name?: string;
|
||||||
username: string;
|
username: string;
|
||||||
email: string | null;
|
email: string | null;
|
||||||
newPassword: string;
|
newPassword: string;
|
||||||
|
|
|
@ -226,7 +226,7 @@ class ProfileView extends React.Component<IProfileViewProps, IProfileViewState>
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
if (user.name !== name) {
|
if (user.name !== name) {
|
||||||
params.name = name;
|
params.realname = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Username
|
// Username
|
||||||
|
@ -295,6 +295,8 @@ class ProfileView extends React.Component<IProfileViewProps, IProfileViewState>
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
logEvent(events.PROFILE_SAVE_CHANGES);
|
logEvent(events.PROFILE_SAVE_CHANGES);
|
||||||
|
params.name = params.realname;
|
||||||
|
delete params.realname;
|
||||||
if (customFields) {
|
if (customFields) {
|
||||||
dispatch(setUser({ customFields, ...params }));
|
dispatch(setUser({ customFields, ...params }));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue