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.

compose: Correct low-attention logic for combined feeds.

Karl Stolleye43ee9dbbe5c
diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.ts
index 22325210192..fdfd3263800 100644
--- a/web/src/compose_recipient.ts
+++ b/web/src/compose_recipient.ts
@@ -31,6 +31,11 @@ type MessageType = "stream" | "private";
let compose_select_recipient_dropdown_widget: DropdownWidget;
function composing_to_current_topic_narrow(): boolean {
+ // If the narrow state's stream ID is undefined, then
+ // the user cannot be composing to a current topic narrow.
+ if (narrow_state.stream_id() === undefined) {
+ return false;
+ }
return (
compose_state.stream_id() === narrow_state.stream_id() &&
util.lower_same(compose_state.topic(), narrow_state.topic() ?? "")
@@ -65,7 +70,7 @@ export let update_recipient_row_attention_level = (): void => {
const is_compose_textarea_focused = document.activeElement?.id === "compose-textarea";
if (
is_compose_textarea_focused &&
- composing_to_current_topic_narrow() &&
+ (composing_to_current_topic_narrow() || composing_to_current_private_message_narrow()) &&
compose_state.has_full_recipient() &&
!compose_state.is_recipient_edited_manually()
) {