mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
message_edit: Move get_upload_object_from_row to upload module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
fb19476c4e
commit
549bae5176
@@ -45,8 +45,6 @@ const currently_editing_messages = new Map();
|
||||
let currently_deleting_messages = [];
|
||||
let currently_topic_editing_messages = [];
|
||||
const currently_echoing_messages = new Map();
|
||||
const upload_objects_by_row = new Map();
|
||||
|
||||
// These variables are designed to preserve the user's most recent
|
||||
// choices when editing a group of messages, to make it convenient to
|
||||
// move several topics in a row with the same settings.
|
||||
@@ -568,7 +566,7 @@ function start_edit_with_content($row, content, edit_box_open_callback) {
|
||||
mode: "edit",
|
||||
row: row_id,
|
||||
});
|
||||
upload_objects_by_row.set(row_id, upload_object);
|
||||
upload.upload_objects_by_message_edit_row.set(row_id, upload_object);
|
||||
}
|
||||
|
||||
export function start($row, edit_box_open_callback) {
|
||||
@@ -778,18 +776,14 @@ export function end_inline_topic_edit($row) {
|
||||
message_lists.current.hide_edit_topic_on_recipient_row($row);
|
||||
}
|
||||
|
||||
export function get_upload_object_from_row(row_id) {
|
||||
return upload_objects_by_row.get(row_id);
|
||||
}
|
||||
|
||||
function remove_uploads_from_row(row_id) {
|
||||
const uploads_for_row = upload_objects_by_row.get(row_id);
|
||||
const uploads_for_row = upload.upload_objects_by_message_edit_row.get(row_id);
|
||||
// We need to cancel all uploads, reset their progress,
|
||||
// and clear the files upon ending the edit.
|
||||
uploads_for_row?.cancelAll();
|
||||
// Since we removed all the uploads from the row, we should
|
||||
// now remove the corresponding upload object from the store.
|
||||
upload_objects_by_row.delete(row_id);
|
||||
upload.upload_objects_by_message_edit_row.delete(row_id);
|
||||
}
|
||||
|
||||
export function end_message_row_edit($row) {
|
||||
|
||||
Reference in New Issue
Block a user