mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
compose: Add notice to confirmation banner.
This commit adds a note to the confirmation banner when a message is scheduled for less than the MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS. The approach here is to use the flatpickr's onClose method. onClose callback is triggered when the user selects a date. We compare the selected date with the minDate set in the flatpickr and based on the time set by the user we update the flag minimum_scheduled_message_delay_minutes_note. Fixes: #28503. Co-authored-by: ankur prabhu <ankurprabhu0531@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
ee51474a05
commit
be8093197e
@@ -74,9 +74,20 @@ export function open_send_later_menu() {
|
||||
current_time.getTime() +
|
||||
scheduled_messages.MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS * 1000,
|
||||
),
|
||||
onClose() {
|
||||
onClose(selectedDates, _dateStr, instance) {
|
||||
// Return to normal state.
|
||||
$send_later_modal_content.css("pointer-events", "all");
|
||||
const selected_date = selectedDates[0];
|
||||
|
||||
if (selected_date && selected_date < instance.config.minDate) {
|
||||
scheduled_messages.set_minimum_scheduled_message_delay_minutes_note(
|
||||
true,
|
||||
);
|
||||
} else {
|
||||
scheduled_messages.set_minimum_scheduled_message_delay_minutes_note(
|
||||
false,
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user