mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
message events: Refactor remove_and_rerender codepath.
The changes made in this commit are as follows:
* We remove the now unused `ui.find_message` which was added
in commit 1666403850.
* We change the function paramter to now accept message ids
instead of messages to eliminate redundant message ids to
message convertion as only the id is required.
* The remove method in MessageListData did not remove the
messages from the hash, it removed only from the items,
this fixes it.
* This commit also fixes a bug where messages are not added
to the current message list if an event is recieved where
messages are moved to this current narrow.
Only the message removal logic was present, which has been
refactored in this commit.
This commit is contained in:
@@ -362,7 +362,7 @@ exports.message_send_error = function (message_id, error_response) {
|
||||
function abort_message(message) {
|
||||
// Remove in all lists in which it exists
|
||||
for (const msg_list of [message_list.all, home_msg_list, current_msg_list]) {
|
||||
msg_list.remove_and_rerender([message]);
|
||||
msg_list.remove_and_rerender([message.id]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user