mirror of https://github.com/vector-im/riot-web
Fix null-guarding regression around reply_to_event dispatch (#8039)
parent
5262d5c315
commit
4b0df21b0a
|
@ -844,7 +844,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||||
case 'reply_to_event':
|
case 'reply_to_event':
|
||||||
if (!this.unmounted &&
|
if (!this.unmounted &&
|
||||||
this.state.searchResults &&
|
this.state.searchResults &&
|
||||||
payload.event.getRoomId() === this.state.roomId &&
|
payload.event?.getRoomId() === this.state.roomId &&
|
||||||
payload.context === TimelineRenderingType.Search
|
payload.context === TimelineRenderingType.Search
|
||||||
) {
|
) {
|
||||||
this.onCancelSearchClick();
|
this.onCancelSearchClick();
|
||||||
|
|
|
@ -201,7 +201,7 @@ class RoomViewStore extends Store<ActionPayload> {
|
||||||
// this can happen when performing a search across all rooms. Persist the data from this event for
|
// this can happen when performing a search across all rooms. Persist the data from this event for
|
||||||
// both room and search timeline rendering types, search will get auto-closed by RoomView at this time.
|
// both room and search timeline rendering types, search will get auto-closed by RoomView at this time.
|
||||||
if ([TimelineRenderingType.Room, TimelineRenderingType.Search].includes(payload.context)) {
|
if ([TimelineRenderingType.Room, TimelineRenderingType.Search].includes(payload.context)) {
|
||||||
if (payload.event?.getRoomId() !== this.state.roomId) {
|
if (payload.event && payload.event.getRoomId() !== this.state.roomId) {
|
||||||
dis.dispatch<ViewRoomPayload>({
|
dis.dispatch<ViewRoomPayload>({
|
||||||
action: Action.ViewRoom,
|
action: Action.ViewRoom,
|
||||||
room_id: payload.event.getRoomId(),
|
room_id: payload.event.getRoomId(),
|
||||||
|
|
Loading…
Reference in New Issue