mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 00:23:49 +00:00
compose_send_menu_popover: Extract function to parse send_at_time.
This will be commonly used to schedule a reminder and a message.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user