From 7cb59bddb0cbac68b911c35e7f0fef643f43af93 Mon Sep 17 00:00:00 2001 From: lukebarnard Date: Mon, 20 Nov 2017 13:12:55 +0000 Subject: [PATCH] Use badge count format for member count in RightPanel (to avoid cosmetic disasters with >9999 members in a room, e.g. HQ) --- src/components/structures/RightPanel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 240a5b2efe1..003c9e88cc5 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -29,6 +29,8 @@ import AccessibleButton from 'matrix-react-sdk/lib/components/views/elements/Acc import { showGroupInviteDialog, showGroupAddRoomDialog } from 'matrix-react-sdk/lib/GroupAddressPicker'; import GroupStoreCache from 'matrix-react-sdk/lib/stores/GroupStoreCache'; +import { formatCount } from 'matrix-react-sdk/lib/utils/FormattingUtils'; + class HeaderButton extends React.Component { constructor() { super(); @@ -264,7 +266,7 @@ module.exports = React.createClass({ const room = cli.getRoom(this.props.roomId); let userIsInRoom; if (room) { - membersBadge = room.getJoinedMembers().length; + membersBadge = formatCount(room.getJoinedMembers().length); userIsInRoom = room.hasMembershipState( this.context.matrixClient.credentials.userId, 'join', );