inbox_ui: Minor refactor.

Use `inbox-folder` class to check if the row is an inbox folder.
This commit is contained in:
Aman Agrawal
2025-07-21 18:43:28 +05:30
committed by Tim Abbott
parent e8aa6e9ecf
commit fa9165236d

View File

@@ -1434,11 +1434,11 @@ export function get_focused_row_message(): {message?: Message | undefined} & (
return {message: undefined, msg_type: "private"}; return {message: undefined, msg_type: "private"};
} }
const stream_id = Number($focused_row.attr("data-stream-id")); if ($focused_row.hasClass("inbox-folder")) {
if (Number.isNaN(stream_id)) {
// This is a channel folder header. // This is a channel folder header.
return {}; return {};
} }
const stream_id = Number($focused_row.attr("data-stream-id"));
compose_state.set_compose_recipient_id(stream_id); compose_state.set_compose_recipient_id(stream_id);
return {message: undefined, msg_type: "stream", stream_id}; return {message: undefined, msg_type: "stream", stream_id};
} }