compose_reply: Fix msg_type being not defined triggering errors.

When focused on filters, `r` keypress to open compose had
`msg_type` set to undefined which shouldn't be the case ever as
we always expect msg_type to be defined when compose is open.
This commit is contained in:
Aman Agrawal
2023-10-17 05:44:25 +00:00
committed by Tim Abbott
parent a814b4f320
commit c54e84cb9b

View File

@@ -32,7 +32,9 @@ export function respond_to_message(opts) {
} else if (inbox_util.is_visible()) {
const message_opts = inbox_ui.get_focused_row_message();
if (message_opts.message === undefined) {
compose_actions.start(message_opts.msg_type, {
// If the user is not focused on inbox header, msg_type
// is not defined, so we open empty compose with nothing prefilled.
compose_actions.start(message_opts.msg_type ?? "stream", {
trigger: "inbox_nofocus",
...message_opts,
});