Auto-dismiss notifications popover if no unread notifications exist

This commit is contained in:
Johannes Zellner
2025-11-03 15:32:01 +01:00
parent bd4e132709
commit b2c8f87276
4 changed files with 66 additions and 61 deletions
+5
View File
@@ -33,6 +33,9 @@ const notificationsAllBusy = ref(false);
function onOpenNotifications(popover, event, elem) {
popover.open(event, elem);
// close after 2 seconds if there is nothing to show
if (notifications.value.length === 0) setTimeout(popover.close, 2000);
}
async function onMarkNotificationRead(notification) {
@@ -55,6 +58,8 @@ async function onMarkAllNotificationRead() {
await refresh();
notificationsAllBusy.value = false;
if (notifications.value.length === 0) setTimeout(helpPopover.value.close, 2000);
}
async function refresh() {