From b500df868ee35fff7408564617c41a5beb194f59 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Tue, 29 May 2018 22:28:58 +0800 Subject: [PATCH] MM-10722 Fix display name of other user after joining a channel (#1709) * fix bundling failed with "mime-db" error Signed-off-by: Saturnino Abril * fix display name of other user after joining a channel Signed-off-by: Saturnino Abril --- .../combined_system_message.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/components/combined_system_message/combined_system_message.js b/app/components/combined_system_message/combined_system_message.js index a7be1859c..132363de9 100644 --- a/app/components/combined_system_message/combined_system_message.js +++ b/app/components/combined_system_message/combined_system_message.js @@ -179,14 +179,17 @@ export default class CombinedSystemMessage extends React.PureComponent { } componentDidMount() { - this.loadUserProfiles(); + this.loadUserProfiles(this.props.allUserIds); } - loadUserProfiles = async () => { - const { - actions, - allUserIds, - } = this.props; + componentWillReceiveProps(nextProps) { + if (this.props.allUserIds !== nextProps.allUserIds) { + this.loadUserProfiles(nextProps.allUserIds); + } + } + + loadUserProfiles = async (allUserIds) => { + const {actions} = this.props; const {data: userProfiles} = await actions.getProfilesByIds(allUserIds); this.setState({userProfiles});