diff --git a/components/NotificationItem.vue b/components/NotificationItem.vue index 243f4da..2606643 100644 --- a/components/NotificationItem.vue +++ b/components/NotificationItem.vue @@ -44,9 +44,10 @@ diff --git a/composables/notifications.ts b/composables/notifications.ts index ede125b..543ac77 100644 --- a/composables/notifications.ts +++ b/composables/notifications.ts @@ -1,12 +1,13 @@ +import type { SerializeObject } from "nitropack"; import type { NotificationModel } from "~/prisma/client/models"; const ws = new WebSocketHandler("/api/v1/notifications/ws"); export const useNotifications = () => - useState>("notifications", () => []); + useState>>("notifications", () => []); ws.listen((e) => { - const notification = JSON.parse(e) as NotificationModel; + const notification = JSON.parse(e) as SerializeObject; const notifications = useNotifications(); notifications.value.push(notification); }); diff --git a/i18n/locales/en_us.json b/i18n/locales/en_us.json index 02ff541..d167034 100644 --- a/i18n/locales/en_us.json +++ b/i18n/locales/en_us.json @@ -13,6 +13,7 @@ "all": "View all {arrow}", "desc": "View and manage your notifications.", "markAllAsRead": "Mark all as read", + "clear": "Clear notifications", "markAsRead": "Mark as read", "none": "No notifications", "notifications": "Notifications", diff --git a/pages/account/notifications.vue b/pages/account/notifications.vue index f625ab4..a1fd539 100644 --- a/pages/account/notifications.vue +++ b/pages/account/notifications.vue @@ -1,20 +1,33 @@