From ea1dbe1f76f9718fbc480addeda573f961ae37b3 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 19 Oct 2017 15:47:52 +0100 Subject: [PATCH] Fix invites to groups without names --- src/components/views/avatars/BaseAvatar.js | 2 +- src/components/views/groups/GroupInviteTile.js | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/views/avatars/BaseAvatar.js b/src/components/views/avatars/BaseAvatar.js index addb637796..f68e98ec3d 100644 --- a/src/components/views/avatars/BaseAvatar.js +++ b/src/components/views/avatars/BaseAvatar.js @@ -110,7 +110,7 @@ module.exports = React.createClass({ let idx = 0; const initial = name[0]; - if ((initial === '@' || initial === '#') && name[1]) { + if ((initial === '@' || initial === '#' || initial === '+') && name[1]) { idx++; } diff --git a/src/components/views/groups/GroupInviteTile.js b/src/components/views/groups/GroupInviteTile.js index 07c0bcf6b9..d7a04247ec 100644 --- a/src/components/views/groups/GroupInviteTile.js +++ b/src/components/views/groups/GroupInviteTile.js @@ -38,19 +38,17 @@ export default React.createClass({ const BaseAvatar = sdk.getComponent('avatars.BaseAvatar'); const EmojiText = sdk.getComponent('elements.EmojiText'); - const av = ( - - ); + const groupName = this.props.group.name || this.props.group.groupId; + + const av = ; const label = - { this.props.group.name } + { groupName } ; const badge =
!
;