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

Commit 237038a

Browse files
authored
Fix RoomView::onSearchClick toggle behaviour (#11605)
Signed-off-by: Michael Telatynski <[email protected]>
1 parent da1daa1 commit 237038a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/components/structures/RoomView.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,12 +1784,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
17841784
};
17851785

17861786
private onSearchClick = (): void => {
1787-
this.setState({
1788-
timelineRenderingType:
1789-
this.state.timelineRenderingType === TimelineRenderingType.Search
1790-
? TimelineRenderingType.Room
1791-
: TimelineRenderingType.Search,
1792-
});
1787+
if (this.state.timelineRenderingType === TimelineRenderingType.Search) {
1788+
this.onCancelSearchClick();
1789+
} else {
1790+
this.setState({
1791+
timelineRenderingType: TimelineRenderingType.Search,
1792+
});
1793+
}
17931794
};
17941795

17951796
private onCancelSearchClick = (): Promise<void> => {

0 commit comments

Comments
 (0)