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

Commit b70297c

Browse files
authored
Merge pull request #6277 from matrix-org/t3chguy/fix/17793
Fix back button on user info card after clicking a permalink
2 parents 14ef38e + b60c2c5 commit b70297c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/stores/RightPanelStore.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {RightPanelPhases, RIGHT_PANEL_PHASES_NO_ARGS} from "./RightPanelStorePha
2222
import {ActionPayload} from "../dispatcher/payloads";
2323
import {Action} from '../dispatcher/actions';
2424
import { SettingLevel } from "../settings/SettingLevel";
25+
import RoomViewStore from './RoomViewStore';
2526

2627
interface RightPanelStoreState {
2728
// 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<ActionPayload> {
147148
switch (payload.action) {
148149
case 'view_room':
149150
case 'view_group':
151+
if (payload.room_id === RoomViewStore.getRoomId()) break; // skip this transition, probably a permalink
152+
150153
// Reset to the member list if we're viewing member info
151154
if (MEMBER_INFO_PHASES.includes(this.state.lastRoomPhase)) {
152155
this.setState({lastRoomPhase: RightPanelPhases.RoomMemberList, lastRoomPhaseParams: {}});

test/end-to-end-tests/src/usecases/rightpanel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ module.exports.goBackToRoomSummaryCard = async function(session) {
3232
// Sometimes our tests have this opened to MemberInfo
3333
await backButton.click();
3434
} catch (e) {
35-
break; // stop trying to go further back
35+
// explicitly check for TimeoutError as this sometimes returned
36+
// `Error: Node is detached from document` due to a re-render race or similar
37+
if (e.name === "TimeoutError") {
38+
break; // stop trying to go further back
39+
}
3640
}
3741
}
3842
};

0 commit comments

Comments
 (0)