From e0f6a7a48dd09cd28a5ada7ad9b22be72d7387a4 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 8 May 2023 18:33:32 -0700 Subject: [PATCH] scheduled_messages: Avoid hardcoding minimum delay. This deduplicates the 5 minutes calculation across the scheduled messages code path. --- web/src/popover_menus.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/popover_menus.js b/web/src/popover_menus.js index 11170532bb..75530a6ff1 100644 --- a/web/src/popover_menus.js +++ b/web/src/popover_menus.js @@ -852,7 +852,11 @@ export function initialize() { do_schedule_message, new Date(current_time.getTime() + 60 * 60 * 1000), { - minDate: new Date(current_time.getTime() + 5 * 60 * 1000), + minDate: new Date( + current_time.getTime() + + scheduled_messages.MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS * + 1000, + ), onClose() { // Return to normal state. $send_later_modal_content.css("pointer-events", "all");