diff --git a/web/src/compose_actions.js b/web/src/compose_actions.js index badf4446b2..4d064c27df 100644 --- a/web/src/compose_actions.js +++ b/web/src/compose_actions.js @@ -59,7 +59,7 @@ function hide_box() { } function show_compose_box(message_type, opts) { - compose_recipient.update_compose_for_message_type(message_type, opts); + compose_recipient.update_compose_for_message_type({...opts, message_type}); $("#compose").css({visibility: "visible"}); // When changing this, edit the 42px in _maybe_autoscroll $(".new_message_textarea").css("min-height", "3em"); diff --git a/web/src/compose_recipient.js b/web/src/compose_recipient.js index a867b72c3f..ce37e1c452 100644 --- a/web/src/compose_recipient.js +++ b/web/src/compose_recipient.js @@ -146,7 +146,7 @@ function switch_message_type(message_type) { topic: compose_state.topic(), private_message_recipient: compose_state.private_message_recipient(), }; - update_compose_for_message_type(message_type, opts); + update_compose_for_message_type(opts); update_placeholder_text(); compose_ui.set_focus(opts); } @@ -164,8 +164,8 @@ function update_recipient_label(stream_id) { } } -export function update_compose_for_message_type(message_type, opts) { - if (message_type === "stream") { +export function update_compose_for_message_type(opts) { + if (opts.message_type === "stream") { $("#compose-direct-recipient").hide(); $("#compose_recipient_box").show(); $("#stream_toggle").addClass("active");