Fix RoomView::onSearchClick toggle behaviour (#11605)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2023-09-13 20:23:33 +01:00 committed by GitHub
parent da1daa1b18
commit 237038aa56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1784,12 +1784,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
};
private onSearchClick = (): void => {
this.setState({
timelineRenderingType:
this.state.timelineRenderingType === TimelineRenderingType.Search
? TimelineRenderingType.Room
: TimelineRenderingType.Search,
});
if (this.state.timelineRenderingType === TimelineRenderingType.Search) {
this.onCancelSearchClick();
} else {
this.setState({
timelineRenderingType: TimelineRenderingType.Search,
});
}
};
private onCancelSearchClick = (): Promise<void> => {