From 4f391645e734f67e4e68b632a6b71d401ae22eb2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 30 Sep 2024 14:50:17 +0100 Subject: [PATCH] Ensure timeline search results are visible even in video rooms (#96) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomView.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 87e8c3c307..37e45d6b8d 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -2521,9 +2521,15 @@ export class RoomView extends React.Component { mx_RoomView_timeline_rr_enabled: this.state.showReadReceipts, }); + let { mainSplitContentType } = this.state; + if (this.state.search) { + // When in the middle of a search force the main split content type to timeline + mainSplitContentType = MainSplitContentType.Timeline; + } + const mainClasses = classNames("mx_RoomView", { mx_RoomView_inCall: Boolean(activeCall), - mx_RoomView_immersive: this.state.mainSplitContentType !== MainSplitContentType.Timeline, + mx_RoomView_immersive: mainSplitContentType !== MainSplitContentType.Timeline, }); const showChatEffects = SettingsStore.getValue("showChatEffects"); @@ -2531,7 +2537,7 @@ export class RoomView extends React.Component { let mainSplitBody: JSX.Element | undefined; let mainSplitContentClassName: string | undefined; // Decide what to show in the main split - switch (this.state.mainSplitContentType) { + switch (mainSplitContentType) { case MainSplitContentType.Timeline: mainSplitContentClassName = "mx_MainSplit_timeline"; mainSplitBody = ( @@ -2595,7 +2601,7 @@ export class RoomView extends React.Component { let viewingCall = false; // Simplify the header for other main split types - switch (this.state.mainSplitContentType) { + switch (mainSplitContentType) { case MainSplitContentType.MaximisedWidget: excludedRightPanelPhaseButtons = []; onAppsClick = null;