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_attention: Handle cases where topics are undefined.

Karl Stolleycb96ddc1ff4b
diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.ts
index 197d8b04454..8730b6bd0ef 100644
--- a/web/src/compose_recipient.ts
+++ b/web/src/compose_recipient.ts
@@ -31,9 +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) {
+ // If the narrow state's stream ID or topic is undefined, then
+ // the user cannot be composing to a current topic narrow. Note
+ // that both lists of channel topics and channel feeds have a
+ // stream_id, but not a topic.
+ if (narrow_state.stream_id() === undefined || narrow_state.topic() === undefined) {
return false;
}
return (