echo: Fix send messages not visible when auto narrowed to recipient.

We simply forgot to `add_to_narrow` locally echoed messages if
the current narrow changed before we received confirmation from
server.
This commit is contained in:
Aman Agrawal 2024-10-30 18:56:22 +05:30 committed by Tim Abbott
parent 42e1517255
commit 3fe1e554a6
2 changed files with 3 additions and 0 deletions

View File

@ -557,6 +557,7 @@ export function process_from_server(messages: ServerMessage[]): ServerMessage[]
// message content, but in practice, there's no harm to just
// doing it unconditionally.
msg_list.view.rerender_messages(msgs_to_rerender_or_add_to_narrow);
msg_list.add_messages(msgs_to_rerender_or_add_to_narrow, {});
}
}
}

View File

@ -47,6 +47,7 @@ message_lists.current = {
},
},
change_message_id: noop,
add_messages: noop,
};
const home_msg_list = {
view: {
@ -62,6 +63,7 @@ const home_msg_list = {
},
preserver_rendered_state: true,
change_message_id: noop,
add_messages: noop,
};
message_lists.all_rendered_message_lists = () => [home_msg_list, message_lists.current];
message_lists.non_rendered_data = () => [];