Maintain reply-to-event when clicking room permalink (#8114)
parent
ad130acd30
commit
81df4c0aeb
|
@ -69,8 +69,6 @@ const INITIAL_STATE = {
|
||||||
// Any error that has occurred during loading
|
// Any error that has occurred during loading
|
||||||
roomLoadError: null,
|
roomLoadError: null,
|
||||||
|
|
||||||
quotingEvent: null,
|
|
||||||
|
|
||||||
replyingToEvent: null,
|
replyingToEvent: null,
|
||||||
|
|
||||||
shouldPeek: false,
|
shouldPeek: false,
|
||||||
|
@ -261,8 +259,6 @@ class RoomViewStore extends Store<ActionPayload> {
|
||||||
joining: payload.joining || false,
|
joining: payload.joining || false,
|
||||||
// Reset replyingToEvent because we don't want cross-room because bad UX
|
// Reset replyingToEvent because we don't want cross-room because bad UX
|
||||||
replyingToEvent: null,
|
replyingToEvent: null,
|
||||||
// pull the user out of Room Settings
|
|
||||||
isEditingSettings: false,
|
|
||||||
viaServers: payload.via_servers,
|
viaServers: payload.via_servers,
|
||||||
wasContextSwitch: payload.context_switch,
|
wasContextSwitch: payload.context_switch,
|
||||||
};
|
};
|
||||||
|
@ -270,6 +266,9 @@ class RoomViewStore extends Store<ActionPayload> {
|
||||||
// Allow being given an event to be replied to when switching rooms but sanity check its for this room
|
// Allow being given an event to be replied to when switching rooms but sanity check its for this room
|
||||||
if (payload.replyingToEvent?.getRoomId() === payload.room_id) {
|
if (payload.replyingToEvent?.getRoomId() === payload.room_id) {
|
||||||
newState.replyingToEvent = payload.replyingToEvent;
|
newState.replyingToEvent = payload.replyingToEvent;
|
||||||
|
} else if (this.state.roomId === payload.room_id) {
|
||||||
|
// if the room isn't being changed, e.g visiting a permalink then maintain replyingToEvent
|
||||||
|
newState.replyingToEvent = this.state.replyingToEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
|
|
Loading…
Reference in New Issue