1
0
mirror of https://github.com/element-hq/element-web.git synced 2025-11-29 21:23:11 +03:00

Fix regression around replying to search results (#8035)

This commit is contained in:
Michael Telatynski
2022-03-11 15:40:49 +00:00
committed by GitHub
parent 1eb67047c9
commit ceb2281d36
2 changed files with 10 additions and 25 deletions

View File

@@ -842,28 +842,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
});
break;
case 'reply_to_event':
if (this.state.searchResults
&& payload.event.getRoomId() === this.state.roomId
&& !this.unmounted
&& payload.context === TimelineRenderingType.Room) {
if (!this.unmounted &&
this.state.searchResults &&
payload.event.getRoomId() === this.state.roomId &&
payload.context === TimelineRenderingType.Search
) {
this.onCancelSearchClick();
}
break;
case 'quote':
if (this.state.searchResults) {
const roomId = payload.event.getRoomId();
if (roomId === this.state.roomId) {
this.onCancelSearchClick();
}
setImmediate(() => {
dis.dispatch<ViewRoomPayload>({
action: Action.ViewRoom,
room_id: roomId,
deferred_action: payload,
metricsTrigger: "MessageSearch",
});
});
// we don't need to re-dispatch as RoomViewStore knows to persist with context=Search also
}
break;
case 'MatrixActions.sync':