Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

rows: Fix get_message_id type.

Anders Kaseorg398c63566e7a
diff --git a/web/src/rows.ts b/web/src/rows.ts
index 73eae4646d6..df684fba93f 100644
--- a/web/src/rows.ts
+++ b/web/src/rows.ts
@@ -112,7 +112,7 @@ export function local_echo_id($message_row: JQuery): string | undefined {
return message_id;
}
-export function get_message_id(elem: string): number | undefined {
+export function get_message_id(elem: HTMLElement): number | undefined {
// Gets the message_id for elem, where elem is a DOM
// element inside a message. This is typically used
// in click handlers for things like the reaction button.
diff --git a/web/src/upload.js b/web/src/upload.js
index 84c07f41c9e..4df31e0e132 100644
--- a/web/src/upload.js
+++ b/web/src/upload.js
@@ -523,7 +523,7 @@ export function initialize() {
upload_files(compose_upload_object, {mode: "compose"}, files);
} else if ($last_drag_drop_edit_container.length !== 0) {
// A message edit box is open; drop there.
- const row_id = rows.get_message_id($last_drag_drop_edit_container);
+ const row_id = rows.get_message_id($last_drag_drop_edit_container[0]);
const $drag_drop_container = get_item("drag_drop_container", {
mode: "edit",
row: row_id,