diff --git a/src/stores/RightPanelStore.ts b/src/stores/RightPanelStore.ts index 1b5e9a3413c..521d124bad5 100644 --- a/src/stores/RightPanelStore.ts +++ b/src/stores/RightPanelStore.ts @@ -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 @@ -68,6 +67,7 @@ const MEMBER_INFO_PHASES = [ export default class RightPanelStore extends Store { private static instance: RightPanelStore; private state: RightPanelStoreState; + private lastRoomId: string; constructor() { super(dis); @@ -147,8 +147,10 @@ export default class RightPanelStore extends Store { __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)) {