diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js
index 6b025ac916..e6bfea83ef 100644
--- a/src/components/structures/RightPanel.js
+++ b/src/components/structures/RightPanel.js
@@ -249,6 +249,11 @@ module.exports = React.createClass({
}
}
+ const isPhaseGroup = [
+ this.Phase.GroupMemberInfo,
+ this.Phase.GroupMemberList
+ ].includes(this.state.phase);
+
let headerButtons = [];
if (this.props.roomId) {
headerButtons = [
@@ -272,7 +277,7 @@ module.exports = React.createClass({
} else if (this.props.groupId) {
headerButtons = [
,
@@ -326,10 +331,7 @@ module.exports = React.createClass({
if (this.props.groupId &&
GroupStoreCache.getGroupStore(this.context.matrixClient, this.props.groupId).isUserPrivileged()
) {
- inviteGroup = [
- this.Phase.GroupMemberInfo,
- this.Phase.GroupMemberList,
- ].includes(this.state.phase) ? (
+ inviteGroup = isPhaseGroup ? (