Merge pull request #3804 from matrix-org/t3chguy/rightpanel

'Members' button always toggle the right panel
pull/21833/head
Travis Ralston 2020-01-16 10:11:24 -07:00 committed by GitHub
commit 3ed7beac78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View File

@ -66,8 +66,13 @@ export default class GroupHeaderButtons extends HeaderButtons {
} }
_onMembersClicked() { _onMembersClicked() {
// This toggles for us, if needed if (this.state.phase === RIGHT_PANEL_PHASES.GroupMemberInfo) {
this.setPhase(RIGHT_PANEL_PHASES.GroupMemberList); // 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() { _onRoomsClicked() {

View File

@ -23,6 +23,7 @@ import { _t } from '../../../languageHandler';
import HeaderButton from './HeaderButton'; import HeaderButton from './HeaderButton';
import HeaderButtons, {HEADER_KIND_ROOM} from './HeaderButtons'; import HeaderButtons, {HEADER_KIND_ROOM} from './HeaderButtons';
import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases"; import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases";
import RightPanelStore from "../../../stores/RightPanelStore";
const MEMBER_PHASES = [ const MEMBER_PHASES = [
RIGHT_PANEL_PHASES.RoomMemberList, RIGHT_PANEL_PHASES.RoomMemberList,
@ -56,8 +57,13 @@ export default class RoomHeaderButtons extends HeaderButtons {
} }
_onMembersClicked() { _onMembersClicked() {
// This toggles for us, if needed if (this.state.phase === RIGHT_PANEL_PHASES.RoomMemberInfo) {
this.setPhase(RIGHT_PANEL_PHASES.RoomMemberList); // 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() { _onFilesClicked() {