From 109a247c8d95b20c49985aa007e99d2dbf555e43 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Wed, 5 Jun 2019 19:29:07 +0300 Subject: [PATCH] [FIX] Profile update (#955) --- app/lib/rocketchat.js | 4 ++-- app/views/ProfileView/index.js | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) 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'));