From a9bea774f988ea663226815c3b46ccfa6ff8a44b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Oct 2024 16:02:38 +0100 Subject: [PATCH] Fix Ctrl+F shortcut not working with minimised room summary card (#28223) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/stores/right-panel/RightPanelStore.ts | 1 + src/stores/right-panel/RightPanelStoreIPanelState.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/stores/right-panel/RightPanelStore.ts b/src/stores/right-panel/RightPanelStore.ts index 94637b9cd4..9da06580dc 100644 --- a/src/stores/right-panel/RightPanelStore.ts +++ b/src/stores/right-panel/RightPanelStore.ts @@ -80,6 +80,7 @@ export default class RightPanelStore extends ReadyWatchingStore { if (this.currentCard.phase !== RightPanelPhases.RoomSummary) { this.setCard({ phase: RightPanelPhases.RoomSummary, state: { focusRoomSearch: true } }); } + this.show(null); } } } diff --git a/src/stores/right-panel/RightPanelStoreIPanelState.ts b/src/stores/right-panel/RightPanelStoreIPanelState.ts index deffe045e6..afb7442563 100644 --- a/src/stores/right-panel/RightPanelStoreIPanelState.ts +++ b/src/stores/right-panel/RightPanelStoreIPanelState.ts @@ -40,6 +40,8 @@ export interface IRightPanelCardStateStored { initialEventId?: string; isInitialEventHighlighted?: boolean; initialEventScrollIntoView?: boolean; + // room summary card + focusRoomSearch?: boolean; } export interface IRightPanelCard { @@ -85,6 +87,7 @@ export function convertCardToStore(panelState: IRightPanelCard): IRightPanelCard memberInfoEventId: !!state?.memberInfoEvent?.getId() ? state.memberInfoEvent.getId() : undefined, initialEventId: !!state?.initialEvent?.getId() ? state.initialEvent.getId() : undefined, memberId: !!state?.member?.userId ? state.member.userId : undefined, + focusRoomSearch: state.focusRoomSearch, }; return { state: stateStored, phase: panelState.phase }; @@ -105,6 +108,7 @@ function convertStoreToCard(panelStateStore: IRightPanelCardStored, room: Room): : undefined, initialEvent: !!stateStored?.initialEventId ? room.findEventById(stateStored.initialEventId) : undefined, member: (!!stateStored?.memberId && room.getMember(stateStored.memberId)) || undefined, + focusRoomSearch: stateStored?.focusRoomSearch, }; return { state: state, phase: panelStateStore.phase };