From 208c62048fa873c0c6e7d3ec2b26b93838c9493a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 28 Jun 2021 15:48:13 +0100 Subject: [PATCH 1/2] Fix right panel store cleaning some state when permalink within room is clicked --- src/stores/RightPanelStore.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stores/RightPanelStore.ts b/src/stores/RightPanelStore.ts index 2bad0572b1..03f12832fd 100644 --- a/src/stores/RightPanelStore.ts +++ b/src/stores/RightPanelStore.ts @@ -22,6 +22,7 @@ import {RightPanelPhases, RIGHT_PANEL_PHASES_NO_ARGS} from "./RightPanelStorePha 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 @@ -147,6 +148,8 @@ export default class RightPanelStore extends Store { switch (payload.action) { case 'view_room': case 'view_group': + if (payload.room_id === RoomViewStore.getRoomId()) break; // skip this transition, probably a permalink + // Reset to the member list if we're viewing member info if (MEMBER_INFO_PHASES.includes(this.state.lastRoomPhase)) { this.setState({lastRoomPhase: RightPanelPhases.RoomMemberList, lastRoomPhaseParams: {}}); From b60c2c5d55fa5fc1624b430bd831d986117e90dd Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 29 Jun 2021 10:37:30 +0100 Subject: [PATCH 2/2] Fix e2e test right panel back behaviour --- test/end-to-end-tests/src/usecases/rightpanel.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/end-to-end-tests/src/usecases/rightpanel.js b/test/end-to-end-tests/src/usecases/rightpanel.js index ae6bb2c771..00a8cde5a6 100644 --- a/test/end-to-end-tests/src/usecases/rightpanel.js +++ b/test/end-to-end-tests/src/usecases/rightpanel.js @@ -32,7 +32,11 @@ module.exports.goBackToRoomSummaryCard = async function(session) { // Sometimes our tests have this opened to MemberInfo await backButton.click(); } catch (e) { - break; // stop trying to go further back + // explicitly check for TimeoutError as this sometimes returned + // `Error: Node is detached from document` due to a re-render race or similar + if (e.name === "TimeoutError") { + break; // stop trying to go further back + } } } };