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.

popover_menus: Show last selected time in send later popover.

Aman Agrawal12a2e3122ffa
diff --git a/web/src/popover_menus.js b/web/src/popover_menus.js
index efd51a0da0a..5b003a7ec67 100644
--- a/web/src/popover_menus.js
+++ b/web/src/popover_menus.js
@@ -859,7 +859,10 @@ export function initialize() {
},
onMount(instance) {
const $popper = $(instance.popper);
-
+ $popper.one("click", ".send_later_selected_send_later_time", () => {
+ const send_at_timestamp = get_selected_send_later_timestamp();
+ do_schedule_message(send_at_timestamp);
+ });
$popper.one("click", ".open_send_later_modal", () => {
if (!compose_validate.validate()) {
return;
@@ -877,13 +880,11 @@ export function initialize() {
possible_send_later_today = false;
}
- const formatted_send_later_time = get_formatted_selected_send_later_time();
$("body").append(
render_send_later_modal({
possible_send_later_today,
send_later_tomorrow,
send_later_custom,
- formatted_send_later_time,
}),
);
overlays.open_modal("send_later_modal", {
@@ -911,18 +912,7 @@ export function initialize() {
".send_later_today, .send_later_tomorrow",
(e) => {
const send_at_time = set_compose_box_schedule(e.currentTarget);
- const not_from_flatpickr = true;
- do_schedule_message(send_at_time, not_from_flatpickr);
- e.preventDefault();
- e.stopPropagation();
- },
- );
- $send_later_modal.one(
- "click",
- ".send_later_selected_send_later_time",
- (e) => {
- const send_at_timestamp = get_selected_send_later_timestamp();
- do_schedule_message(send_at_timestamp);
+ do_schedule_message(send_at_time);
e.preventDefault();
e.stopPropagation();
},
diff --git a/web/templates/send_later_modal.hbs b/web/templates/send_later_modal.hbs
index c87128a6b00..f1e275cdb7b 100644
--- a/web/templates/send_later_modal.hbs
+++ b/web/templates/send_later_modal.hbs
@@ -22,11 +22,6 @@
<a id="{{@key}}" class="send_later_tomorrow" tabindex="0">{{this.text}}</a>
</li>
{{/each}}
- {{#if formatted_send_later_time}}
- <li>
- <a class="send_later_selected_send_later_time" tabindex="0">{{formatted_send_later_time}}</a>
- </li>
- {{/if}}
<li>
<a class="send_later_custom" tabindex="0">{{t 'Custom time'}}</a>
</li>
diff --git a/web/templates/send_later_popover.hbs b/web/templates/send_later_popover.hbs
index c17e603a104..64747e83c08 100644
--- a/web/templates/send_later_popover.hbs
+++ b/web/templates/send_later_popover.hbs
@@ -2,6 +2,11 @@
<li>
<a class="open_send_later_modal" tabindex="0">{{t "Schedule message" }}</a>
</li>
+ {{#if formatted_send_later_time}}
+ <li>
+ <a class="send_later_selected_send_later_time" tabindex="0">{{t 'Schedule for {formatted_send_later_time}' }}</a>
+ </li>
+ {{/if}}
<hr />
<li>
<a href="#scheduled" tabindex="0">{{t "View scheduled messages" }}</a>