mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
refactor: Move "send button" related code from compose_validate.js.
This commit moves "send button" related code from `compose_validate.js` to `compose.js` as it makes more sense there.
This commit is contained in:
@@ -266,6 +266,11 @@ export function enter_with_preview_open() {
|
||||
}
|
||||
}
|
||||
|
||||
function show_sending_indicator(whats_happening) {
|
||||
$("#sending-indicator").text(whats_happening);
|
||||
$("#sending-indicator").show();
|
||||
}
|
||||
|
||||
export function finish() {
|
||||
clear_preview_area();
|
||||
clear_invites();
|
||||
@@ -283,6 +288,12 @@ export function finish() {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
$("#compose-send-button").prop("disabled", true).trigger("blur");
|
||||
if (reminder.is_deferred_delivery(message_content)) {
|
||||
show_sending_indicator($t({defaultMessage: "Scheduling..."}));
|
||||
} else {
|
||||
show_sending_indicator($t({defaultMessage: "Sending..."}));
|
||||
}
|
||||
if (!compose_validate.validate()) {
|
||||
// If the message failed validation, hide the sending indicator.
|
||||
$("#sending-indicator").hide();
|
||||
|
||||
Reference in New Issue
Block a user