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_send_menu_popover: Extract function to parse send_at_time.

Aman Agrawal1384a8d19bf1
diff --git a/web/src/compose_send_menu_popover.js b/web/src/compose_send_menu_popover.js
index db6995f9ef9..4c4978cde30 100644
--- a/web/src/compose_send_menu_popover.js
+++ b/web/src/compose_send_menu_popover.js
@@ -118,13 +118,17 @@ export function open_send_later_menu() {
});
}
-export function do_schedule_message(send_at_time) {
- modals.close_if_open("send_later_modal");
-
+function parse_sent_at_time(send_at_time) {
if (!Number.isInteger(send_at_time)) {
// Convert to timestamp if this is not a timestamp.
- send_at_time = Math.floor(Date.parse(send_at_time) / 1000);
+ return Math.floor(Date.parse(send_at_time) / 1000);
}
+ return send_at_time;
+}
+
+export function do_schedule_message(send_at_time) {
+ modals.close_if_open("send_later_modal");
+ send_at_time = parse_sent_at_time(send_at_time);
scheduled_messages.set_selected_schedule_timestamp(send_at_time);
compose.finish(true);
}