From 6b8871784e24549be0582bf034cacc3ac8cf9df8 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Tue, 17 Dec 2024 14:09:53 +0100 Subject: [PATCH] #34 - hide notif count if no unread notif --- src/components/Menu.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Menu.vue b/src/components/Menu.vue index b07db90..c27d76e 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -160,8 +160,11 @@ function collapse() { } function notificationCount() { - return user.value.notifications.map((notification) => notification.isRead) - .length; + const count = user.value.notifications.map( + (notification) => notification.isRead + ).length; + if (count === 0) return undefined; + return count; }