From b748c6288064e0557f349cf9eb4b11b6dc427b00 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 28 Nov 2017 15:40:36 +0000 Subject: [PATCH] Renames for clarification --- src/components/views/messages/SenderProfile.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/views/messages/SenderProfile.js b/src/components/views/messages/SenderProfile.js index e2f2eb3cea..d2ef8fe3a3 100644 --- a/src/components/views/messages/SenderProfile.js +++ b/src/components/views/messages/SenderProfile.js @@ -38,7 +38,7 @@ export default React.createClass({ getInitialState() { return { - groups: null, + userGroups: null, relatedGroups: [], }; }, @@ -49,9 +49,9 @@ export default React.createClass({ FlairStore.getPublicisedGroupsCached( this.context.matrixClient, this.props.mxEvent.getSender(), - ).then((groups) => { + ).then((userGroups) => { if (this.unmounted) return; - this.setState({groups}); + this.setState({userGroups}); }); this.context.matrixClient.on('RoomState.events', this.onRoomStateEvents); @@ -93,16 +93,16 @@ export default React.createClass({ return ; // emote message must include the name so don't duplicate it } - let groups = this.state.groups || []; + let displayedGroups = this.state.userGroups || []; if (this.state.relatedGroups && this.state.relatedGroups.length > 0) { - groups = groups.filter((groupId) => { + displayedGroups = displayedGroups.filter((groupId) => { return this.state.relatedGroups.includes(groupId); }); } else { - groups = []; + displayedGroups = []; } - name = groups.length > 0 ? name.replace(' (IRC)', '') : name; + name = displayedGroups.length > 0 ? name.replace(' (IRC)', '') : name; const nameElem = { name || '' }; @@ -114,7 +114,7 @@ export default React.createClass({ { this.props.enableFlair ? : null }