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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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':