Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3804 from matrix-org/t3chguy/rightpanel
Browse files Browse the repository at this point in the history
'Members' button always toggle the right panel
  • Loading branch information
turt2live authored Jan 16, 2020
2 parents 64c4677 + cd9fc72 commit 3ed7bea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/components/views/right_panel/GroupHeaderButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ export default class GroupHeaderButtons extends HeaderButtons {
}

_onMembersClicked() {
// This toggles for us, if needed
this.setPhase(RIGHT_PANEL_PHASES.GroupMemberList);
if (this.state.phase === RIGHT_PANEL_PHASES.GroupMemberInfo) {
// send the active phase to trigger a toggle
this.setPhase(RIGHT_PANEL_PHASES.GroupMemberInfo);
} else {
// This toggles for us, if needed
this.setPhase(RIGHT_PANEL_PHASES.GroupMemberList);
}
}

_onRoomsClicked() {
Expand Down
10 changes: 8 additions & 2 deletions src/components/views/right_panel/RoomHeaderButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { _t } from '../../../languageHandler';
import HeaderButton from './HeaderButton';
import HeaderButtons, {HEADER_KIND_ROOM} from './HeaderButtons';
import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases";
import RightPanelStore from "../../../stores/RightPanelStore";

const MEMBER_PHASES = [
RIGHT_PANEL_PHASES.RoomMemberList,
Expand Down Expand Up @@ -56,8 +57,13 @@ export default class RoomHeaderButtons extends HeaderButtons {
}

_onMembersClicked() {
// This toggles for us, if needed
this.setPhase(RIGHT_PANEL_PHASES.RoomMemberList);
if (this.state.phase === RIGHT_PANEL_PHASES.RoomMemberInfo) {
// send the active phase to trigger a toggle
this.setPhase(RIGHT_PANEL_PHASES.RoomMemberInfo, RightPanelStore.getSharedInstance().roomPanelPhaseParams);
} else {
// This toggles for us, if needed
this.setPhase(RIGHT_PANEL_PHASES.RoomMemberList);
}
}

_onFilesClicked() {
Expand Down

0 comments on commit 3ed7bea

Please sign in to comment.