mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
js: Simplify code using default parameters and destructuring.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
4703256c91
commit
7656d44abc
@@ -334,11 +334,7 @@ export function send_message_success(local_id, message_id, locally_echoed) {
|
||||
echo.reify_message_id(local_id, message_id);
|
||||
}
|
||||
|
||||
export function send_message(request) {
|
||||
if (request === undefined) {
|
||||
request = create_message_object();
|
||||
}
|
||||
|
||||
export function send_message(request = create_message_object()) {
|
||||
if (request.type === "private") {
|
||||
request.to = JSON.stringify(request.to);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user