scheduled_messages: Avoid hardcoding minimum delay.

This deduplicates the 5 minutes calculation across the scheduled
messages code path.
This commit is contained in:
Tim Abbott 2023-05-08 18:33:32 -07:00
parent 20be0759b5
commit e0f6a7a48d
1 changed files with 5 additions and 1 deletions

View File

@ -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");