mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 11:03:54 +00:00
js: Convert _.extend to spread syntax or Object.assign.
This is not always a behavior-preserving translation: _.extend mutates its first argument. However, the code does not always appear to have been written to expect that. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
6f32ef749f
commit
dbffb2a614
@@ -169,19 +169,18 @@ exports.maybe_scroll_up_selected_message = function () {
|
||||
};
|
||||
|
||||
function fill_in_opts_from_current_narrowed_view(msg_type, opts) {
|
||||
let default_opts = {
|
||||
return {
|
||||
message_type: msg_type,
|
||||
stream: '',
|
||||
topic: '',
|
||||
private_message_recipient: '',
|
||||
trigger: 'unknown',
|
||||
};
|
||||
|
||||
// Set default parameters based on the current narrowed view.
|
||||
const compose_opts = narrow_state.set_compose_defaults();
|
||||
default_opts = _.extend(default_opts, compose_opts);
|
||||
opts = _.extend(default_opts, opts);
|
||||
return opts;
|
||||
// Set default parameters based on the current narrowed view.
|
||||
...narrow_state.set_compose_defaults(),
|
||||
|
||||
...opts,
|
||||
};
|
||||
}
|
||||
|
||||
function same_recipient_as_before(msg_type, opts) {
|
||||
|
||||
Reference in New Issue
Block a user