rows: Fix logic for finding drafts rows.

This commit is contained in:
Tim Abbott 2023-11-10 10:06:52 -08:00
parent 554f33d033
commit 07769aec4b
1 changed files with 4 additions and 4 deletions

View File

@ -70,13 +70,13 @@ export function visible_range(start_id, end_id) {
return rows;
}
export function is_draft_row($row) {
return $row.find("#drafts_table .restore-overlay-message").length >= 1;
export function is_overlay_row($row) {
return $row.closest(".overlay-message-row").length >= 1;
}
export function id($message_row) {
if (is_draft_row($message_row)) {
blueslip.error("Drafts have no zid");
if (is_overlay_row($message_row)) {
blueslip.error("Drafts and scheduled messages have no zid");
return undefined;
}