scheduled_messages_overlay_ui: Use CSS to display no scheduled messages.

This commit is contained in:
Aman Agrawal 2023-05-01 11:36:35 +00:00 committed by Tim Abbott
parent 1b60019c60
commit eb5f679121
2 changed files with 13 additions and 13 deletions

View File

@ -64,9 +64,6 @@ export function launch() {
url: "/json/scheduled_messages", url: "/json/scheduled_messages",
success(data) { success(data) {
hide_loading_indicator(); hide_loading_indicator();
if (data.scheduled_messages.length === 0) {
$(".no-overlay-messages").show();
} else {
// Saving formatted data is helpful when user is trying to edit a scheduled message. // Saving formatted data is helpful when user is trying to edit a scheduled message.
scheduled_messages.override_scheduled_messages_data( scheduled_messages.override_scheduled_messages_data(
format(data.scheduled_messages), format(data.scheduled_messages),
@ -76,7 +73,6 @@ export function launch() {
}); });
const $messages_list = $("#scheduled_messages_overlay .overlay-messages-list"); const $messages_list = $("#scheduled_messages_overlay .overlay-messages-list");
$messages_list.append(rendered_list); $messages_list.append(rendered_list);
}
}, },
error(xhr) { error(xhr) {
hide_loading_indicator(); hide_loading_indicator();

View File

@ -12,5 +12,9 @@
.no-overlay-messages { .no-overlay-messages {
display: none; display: none;
&:only-child {
display: block;
}
} }
} }