diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 01635f99..b7ccf6c0 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -644,9 +644,9 @@ const RocketChat = { // RC 0.55.0 return this.sdk.methodCall('saveRoomSettings', rid, params); }, - saveUserProfile(data) { + saveUserProfile(data, customFields) { // RC 0.62.2 - return this.sdk.post('users.updateOwnBasicInfo', { data }); + return this.sdk.post('users.updateOwnBasicInfo', { data, customFields }); }, saveUserPreferences(params) { // RC 0.51.0 diff --git a/app/views/ProfileView/index.js b/app/views/ProfileView/index.js index b4a02f4f..c86e25ea 100644 --- a/app/views/ProfileView/index.js +++ b/app/views/ProfileView/index.js @@ -210,12 +210,13 @@ export default class ProfileView extends React.Component { } } - params.customFields = customFields; + const result = await RocketChat.saveUserProfile(params, customFields); - const result = await RocketChat.saveUserProfile(params); if (result.success) { - if (params.customFields) { - setUser({ customFields }); + if (customFields) { + setUser({ customFields, ...params }); + } else { + setUser({ ...params }); } this.setState({ saving: false }); this.toast.show(I18n.t('Profile_saved_successfully'));