mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
message_edit: Close message edit UI after message is moved.
Currently, if we navigate to some other topic/stream while the message is being moved, the message edit UI still remains open as we do not get its `row` in `message_lists.current` since the message has not moved yet to the stream/topic we navigated. Hence the correct thing to do would be to delete the message_id from `currently_editing_messages` if it exists there but we cannot find the row. Fixes #21724.
This commit is contained in:
@@ -805,6 +805,17 @@ export function end_message_row_edit($row) {
|
||||
$row.find("input.message_edit_topic").trigger("blur");
|
||||
}
|
||||
|
||||
export function end_message_edit(message_id) {
|
||||
const $row = message_lists.current.get_row(message_id);
|
||||
if ($row.length > 0) {
|
||||
end_message_row_edit($row);
|
||||
} else if (currently_editing_messages.has(message_id)) {
|
||||
// We should delete the message_id from currently_editing_messages
|
||||
// if it exists there but we cannot find the row.
|
||||
currently_editing_messages.delete(message_id);
|
||||
}
|
||||
}
|
||||
|
||||
export function save_inline_topic_edit($row) {
|
||||
const msg_list = message_lists.current;
|
||||
let message_id = rows.id_for_recipient_row($row);
|
||||
|
||||
Reference in New Issue
Block a user