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 #6341 from matrix-org/t3chguy/fix/17910
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Jul 12, 2021
2 parents 83a4a20 + 2ef714b commit a3ea120
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/stores/RightPanelStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { RightPanelPhases, RIGHT_PANEL_PHASES_NO_ARGS } from "./RightPanelStoreP
import { ActionPayload } from "../dispatcher/payloads";
import { Action } from '../dispatcher/actions';
import { SettingLevel } from "../settings/SettingLevel";
import RoomViewStore from './RoomViewStore';

interface RightPanelStoreState {
// Whether or not to show the right panel at all. We split out rooms and groups
Expand Down Expand Up @@ -68,6 +67,7 @@ const MEMBER_INFO_PHASES = [
export default class RightPanelStore extends Store<ActionPayload> {
private static instance: RightPanelStore;
private state: RightPanelStoreState;
private lastRoomId: string;

constructor() {
super(dis);
Expand Down Expand Up @@ -147,8 +147,10 @@ export default class RightPanelStore extends Store<ActionPayload> {
__onDispatch(payload: ActionPayload) {
switch (payload.action) {
case 'view_room':
if (payload.room_id === this.lastRoomId) break; // skip this transition, probably a permalink
// fallthrough
case 'view_group':
if (payload.room_id === RoomViewStore.getRoomId()) break; // skip this transition, probably a permalink
this.lastRoomId = payload.room_id;

// Reset to the member list if we're viewing member info
if (MEMBER_INFO_PHASES.includes(this.state.lastRoomPhase)) {
Expand Down

0 comments on commit a3ea120

Please sign in to comment.