compose: Fix behavior when scheduling message using slash command.

We show the loading spinner when scheduling message using slash
command as the submit button present is "Send" button and not
"Schedule" button. This commit fixes the behavior to hide the
loading spinner in case of both success and error and also resets
the UI (mainly enabling the textarea element and clearing the
compose box) after successful scheduling of message using the
slash command.
This commit is contained in:
Sahil Batra
2023-04-25 22:56:33 +05:30
committed by Tim Abbott
parent 639af1d56d
commit 0e20cdfa50
2 changed files with 4 additions and 1 deletions

View File

@@ -332,7 +332,8 @@ export function finish() {
if (popover_menus.is_time_selected_for_schedule()) {
schedule_message_to_custom_date();
} else if (reminder.is_deferred_delivery(message_content)) {
reminder.schedule_message();
const request = create_message_object();
reminder.schedule_message(request, clear_compose_box);
} else {
send_message();
}