Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
compose: Allow stream_id of ComposeTriggeredOptions to be undefined.
evykassirer55cf08c4e634
diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.tsindex 9d176b0b80d..1c3a314b330 100644--- a/web/src/compose_recipient.ts+++ b/web/src/compose_recipient.ts@@ -170,8 +170,8 @@ function switch_message_type(message_type: MessageType): void {compose_ui.set_focus(opts);}-function update_recipient_label(stream_id: number): void {- const stream = stream_data.get_sub_by_id(stream_id);+function update_recipient_label(stream_id?: number): void {+ const stream = stream_id !== undefined ? stream_data.get_sub_by_id(stream_id) : undefined;if (stream === undefined) {$("#compose_select_recipient_widget .dropdown_widget_value").text($t({defaultMessage: "Select a stream"}),diff --git a/web/src/compose_ui.ts b/web/src/compose_ui.tsindex 124ab8b7df8..ed8488c59ac 100644--- a/web/src/compose_ui.ts+++ b/web/src/compose_ui.ts@@ -28,7 +28,7 @@ export type ComposeTriggeredOptions = {| {message_type: "stream";topic: string;- stream_id: number;+ stream_id?: number;}| {message_type: "private";@@ -102,7 +102,7 @@ function get_focus_area(opts: ComposeTriggeredOptions): string {if (opts.message_type === "stream" && opts.stream_id && !opts.topic) {return "input#stream_message_recipient_topic";} else if (- (opts.message_type === "stream" && opts.stream_id) ||+ (opts.message_type === "stream" && opts.stream_id !== undefined) ||(opts.message_type === "private" && opts.private_message_recipient)) {if (opts.trigger === "clear topic button") {