default message when no notifications

This commit is contained in:
amazuecos
2024-12-04 18:26:37 +01:00
parent 8f907b2762
commit 16cec58431
3 changed files with 6 additions and 2 deletions

View File

@ -28,5 +28,6 @@ return [
"add_notification" => "Notificación",
"check_as_unviewed" => "Marcar como no leídos",
"add_notification_message" => "Envía a los usuarios añadidos una notificación con los mensajes presentes en el chat.",
"chat_title_presupuesto" => 'Presupuesto[{title,string,0}][{id}]'
"chat_title_presupuesto" => 'Presupuesto[{title,string,0}][{id}]',
"no_messages_notification" => 'No hay mensajes que revisar por el momento'
];

View File

@ -136,8 +136,9 @@ $picture = "/assets/img/default-user.png";
<div class="container-m-nx m-2">
<div class="sidebar-body">
<!-- Contacts -->
<h6 id="chat-message-notification-title"><?= lang("Chat.no_messages_notification") ?> </h6>
<ul class="list-unstyled chat-contact-list mb-0" id="chat-notification-list">
</ul>
</div>
</div>

View File

@ -722,9 +722,11 @@ export const showNotificationMessages = (dom) => {
dom.empty()
$("#chat-notification-number")
if (data.totalMessages > 0) {
$("#chat-message-notification-title").addClass("d-none")
$("#chat-notification-number").removeClass("d-none")
$("#chat-notification-number").text(data.totalMessages ?? 0)
} else {
$("#chat-message-notification-title").removeClass("d-none")
$("#chat-notification-number").addClass("d-none")
$("#chat-notification-number").text(0)
}