Merge pull request #6277 from matrix-org/t3chguy/fix/17793
Fix back button on user info card after clicking a permalink
This commit is contained in:
commit
b70297c510
2 changed files with 8 additions and 1 deletions
|
@ -22,6 +22,7 @@ import {RightPanelPhases, RIGHT_PANEL_PHASES_NO_ARGS} from "./RightPanelStorePha
|
||||||
import {ActionPayload} from "../dispatcher/payloads";
|
import {ActionPayload} from "../dispatcher/payloads";
|
||||||
import {Action} from '../dispatcher/actions';
|
import {Action} from '../dispatcher/actions';
|
||||||
import { SettingLevel } from "../settings/SettingLevel";
|
import { SettingLevel } from "../settings/SettingLevel";
|
||||||
|
import RoomViewStore from './RoomViewStore';
|
||||||
|
|
||||||
interface RightPanelStoreState {
|
interface RightPanelStoreState {
|
||||||
// Whether or not to show the right panel at all. We split out rooms and groups
|
// 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> {
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'view_room':
|
case 'view_room':
|
||||||
case 'view_group':
|
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
|
// Reset to the member list if we're viewing member info
|
||||||
if (MEMBER_INFO_PHASES.includes(this.state.lastRoomPhase)) {
|
if (MEMBER_INFO_PHASES.includes(this.state.lastRoomPhase)) {
|
||||||
this.setState({lastRoomPhase: RightPanelPhases.RoomMemberList, lastRoomPhaseParams: {}});
|
this.setState({lastRoomPhase: RightPanelPhases.RoomMemberList, lastRoomPhaseParams: {}});
|
||||||
|
|
|
@ -32,7 +32,11 @@ module.exports.goBackToRoomSummaryCard = async function(session) {
|
||||||
// Sometimes our tests have this opened to MemberInfo
|
// Sometimes our tests have this opened to MemberInfo
|
||||||
await backButton.click();
|
await backButton.click();
|
||||||
} catch (e) {
|
} 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue