compose-closed-ui: Fix inbox and recent views not updating button.

Both the inbox and recent conversation views pass information about
the reply recipient to this function's caller so that the button
text can be updated for the focused row.

Therefore, the check for an undefined current message list should
be inside the case where the recipient information parameter is
undefined.

This was changed in f630272b4c when non-message list views set
undefined for the current message list.

(cherry picked from commit 4f163e5ad2)
This commit is contained in:
Lauryn Menard
2025-03-24 18:32:18 +01:00
committed by Tim Abbott
parent 2efef3a0e6
commit 9080684585

View File

@@ -46,11 +46,13 @@ export function get_recipient_label(
// actual message objects with fake objects containing just a
// couple fields, both those constructed here and potentially
// passed in.
if (message_lists.current === undefined) {
return undefined;
}
if (recipient_information === undefined) {
// We check the current message list for information about the
// reply recipient for the closed compose box button label.
if (message_lists.current === undefined) {
return undefined;
}
if (message_lists.current.visibly_empty()) {
// For empty narrows where there's a clear reply target,
// i.e. stream+topic or a single direct message conversation,