From be5ff217dabb84221f3ce497a17df251d52b0e10 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Tue, 10 Sep 2019 19:08:39 +0200 Subject: [PATCH] Replicated missing user functionality for system messages from webapp in RN (#3236) --- .../combined_system_message/combined_system_message.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/combined_system_message/combined_system_message.js b/app/components/combined_system_message/combined_system_message.js index 72d6e82b0..fd66ff9b7 100644 --- a/app/components/combined_system_message/combined_system_message.js +++ b/app/components/combined_system_message/combined_system_message.js @@ -241,12 +241,16 @@ export default class CombinedSystemMessage extends React.PureComponent { getUsernamesByIds = (userIds = []) => { const {currentUserId, currentUsername} = this.props; const allUsernames = this.getAllUsernames(); + + const {formatMessage} = this.context.intl; + const someone = formatMessage({id: t('channel_loader.someone'), defaultMessage: 'Someone'}); + const usernames = userIds. filter((userId) => { return userId !== currentUserId && userId !== currentUsername; }). map((userId) => { - return `@${allUsernames[userId]}`; + return allUsernames[userId] ? `@${allUsernames[userId]}` : someone; }).filter((username) => { return username && username !== ''; });