Added Notifications

This commit is contained in:
2026-05-18 22:06:04 +10:00
parent e1bed676e4
commit 1846cb6a6d
30 changed files with 87 additions and 74 deletions
@@ -21,6 +21,10 @@ const markAllRead = async (notifications: Notification[]) => {
unread.forEach(n => n.read_at = new Date().toISOString())
}
const emit = defineEmits<{
(e: 'update:unreadCount', value: number): void
}>()
watch(open, async (isOpen) => {
if (!isOpen || notifications.value.length) return
loading.value = true
@@ -28,6 +32,7 @@ watch(open, async (isOpen) => {
notifications.value = data
loading.value = false
await markAllRead(notifications.value)
emit('update:unreadCount', 0) // <-- add this
})
</script>
@@ -84,7 +89,8 @@ watch(open, async (isOpen) => {
.notif-menu {
position: absolute;
top: calc(100% + 0.4rem);
right: 0;
left: 50%;
transform: translateX(-50%);
width: 320px;
background: var(--bg);
border: 1px solid rgba(56, 189, 248, 0.12);