Renames for clarification
This commit is contained in:
parent
3addb924b1
commit
b748c62880
1 changed files with 8 additions and 8 deletions
|
@ -38,7 +38,7 @@ export default React.createClass({
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
groups: null,
|
userGroups: null,
|
||||||
relatedGroups: [],
|
relatedGroups: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -49,9 +49,9 @@ export default React.createClass({
|
||||||
|
|
||||||
FlairStore.getPublicisedGroupsCached(
|
FlairStore.getPublicisedGroupsCached(
|
||||||
this.context.matrixClient, this.props.mxEvent.getSender(),
|
this.context.matrixClient, this.props.mxEvent.getSender(),
|
||||||
).then((groups) => {
|
).then((userGroups) => {
|
||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
this.setState({groups});
|
this.setState({userGroups});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.context.matrixClient.on('RoomState.events', this.onRoomStateEvents);
|
this.context.matrixClient.on('RoomState.events', this.onRoomStateEvents);
|
||||||
|
@ -93,16 +93,16 @@ export default React.createClass({
|
||||||
return <span />; // emote message must include the name so don't duplicate it
|
return <span />; // 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) {
|
if (this.state.relatedGroups && this.state.relatedGroups.length > 0) {
|
||||||
groups = groups.filter((groupId) => {
|
displayedGroups = displayedGroups.filter((groupId) => {
|
||||||
return this.state.relatedGroups.includes(groupId);
|
return this.state.relatedGroups.includes(groupId);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
groups = [];
|
displayedGroups = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
name = groups.length > 0 ? name.replace(' (IRC)', '') : name;
|
name = displayedGroups.length > 0 ? name.replace(' (IRC)', '') : name;
|
||||||
|
|
||||||
const nameElem = <EmojiText key='name'>{ name || '' }</EmojiText>;
|
const nameElem = <EmojiText key='name'>{ name || '' }</EmojiText>;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ export default React.createClass({
|
||||||
{ this.props.enableFlair ?
|
{ this.props.enableFlair ?
|
||||||
<Flair key='flair'
|
<Flair key='flair'
|
||||||
userId={mxEvent.getSender()}
|
userId={mxEvent.getSender()}
|
||||||
groups={groups}
|
groups={displayedGroups}
|
||||||
/>
|
/>
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue