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_actions: Include message type in same_recipient_as_before opts.

evykassirer3ea46542ce48
diff --git a/web/src/compose_actions.js b/web/src/compose_actions.js
index 123abbcbb9c..128d258deb0 100644
--- a/web/src/compose_actions.js
+++ b/web/src/compose_actions.js
@@ -172,13 +172,13 @@ export function fill_in_opts_from_current_narrowed_view(msg_type, opts) {
};
}
-function same_recipient_as_before(msg_type, opts) {
+function same_recipient_as_before(opts) {
return (
- compose_state.get_message_type() === msg_type &&
- ((msg_type === "stream" &&
+ compose_state.get_message_type() === opts.message_type &&
+ ((opts.message_type === "stream" &&
opts.stream_id === compose_state.stream_id() &&
opts.topic === compose_state.topic()) ||
- (msg_type === "private" &&
+ (opts.message_type === "private" &&
opts.private_message_recipient === compose_state.private_message_recipient()))
);
}
@@ -235,7 +235,7 @@ export function start(msg_type, opts) {
// with (like from a draft), save any existing content as a draft, and clear the compose box.
if (
compose_state.composing() &&
- (!same_recipient_as_before(msg_type, opts) || opts.content !== undefined)
+ (!same_recipient_as_before({...opts, message_type: msg_type}) || opts.content !== undefined)
) {
drafts.update_draft();
clear_box();