upload: Centralize config object construction.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-05-14 18:39:14 -07:00
committed by Tim Abbott
parent d9f05121d9
commit 25b29b5cd4
3 changed files with 53 additions and 47 deletions

View File

@@ -578,10 +578,7 @@ function start_edit_with_content($row, content, edit_box_open_callback) {
edit_box_open_callback();
}
const row_id = rows.id($row);
upload.setup_upload({
mode: "edit",
row: row_id,
});
upload.setup_upload(upload.edit_config(row_id));
}
export function start($row, edit_box_open_callback) {
@@ -795,7 +792,7 @@ export function end_message_row_edit($row) {
const row_id = rows.id($row);
// Clean up the upload handler
upload.deactivate_upload({mode: "edit", row: row_id});
upload.deactivate_upload(upload.edit_config(row_id));
const message = message_lists.current.get(row_id);
if (message !== undefined && currently_editing_messages.has(message.id)) {