From 871032e1bc5745c9c136d3d306e5d90adaf309c1 Mon Sep 17 00:00:00 2001 From: Charlie Calendre <57274151+c-cal@users.noreply.github.com> Date: Thu, 10 Feb 2022 10:20:48 +0100 Subject: [PATCH] Fix space member list opening with back button (#7773) --- src/stores/right-panel/RightPanelStore.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/stores/right-panel/RightPanelStore.ts b/src/stores/right-panel/RightPanelStore.ts index 8d54d1ef4db..d815a979863 100644 --- a/src/stores/right-panel/RightPanelStore.ts +++ b/src/stores/right-panel/RightPanelStore.ts @@ -372,12 +372,14 @@ export default class RightPanelStore extends ReadyWatchingStore { SettingsStore.getValue("feature_right_panel_default_open") && !this.byRoom[this.viewedRoomId]?.isOpen ) { + const history = [{ phase: RightPanelPhases.RoomMemberList }]; + const room = this.viewedRoomId && this.mxClient?.getRoom(this.viewedRoomId); + if (!room?.isSpaceRoom()) { + history.unshift({ phase: RightPanelPhases.RoomSummary }); + } this.byRoom[this.viewedRoomId] = { isOpen: true, - history: [ - { phase: RightPanelPhases.RoomSummary }, - { phase: RightPanelPhases.RoomMemberList }, - ], + history, }; } this.emitAndUpdateSettings();