diff --git a/components/NotificationItem.vue b/components/NotificationItem.vue index 243f4da..b81ee30 100644 --- a/components/NotificationItem.vue +++ b/components/NotificationItem.vue @@ -44,9 +44,12 @@ diff --git a/composables/notifications.ts b/composables/notifications.ts index ede125b..637fe7e 100644 --- a/composables/notifications.ts +++ b/composables/notifications.ts @@ -1,12 +1,16 @@ +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/eslint.config.mjs b/eslint.config.mjs index 0576c43..a287ae9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,6 +2,7 @@ import withNuxt from "./.nuxt/eslint.config.mjs"; import eslintConfigPrettier from "eslint-config-prettier/flat"; import vueI18n from "@intlify/eslint-plugin-vue-i18n"; +import noPrismaDelete from "./rules/no-prisma-delete.mts"; export default withNuxt([ eslintConfigPrettier, @@ -19,6 +20,7 @@ export default withNuxt([ }, ], "@intlify/vue-i18n/no-missing-keys": "error", + "drop/no-prisma-delete": "error", }, settings: { "vue-i18n": { @@ -29,5 +31,8 @@ export default withNuxt([ messageSyntaxVersion: "^11.0.0", }, }, + plugins: { + drop: { rules: { "no-prisma-delete": noPrismaDelete } }, + }, }, ]); 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/package.json b/package.json index 3e632df..bc18b7b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "@discordapp/twemoji": "^16.0.1", - "@drop-oss/droplet": "3.4.0", + "@drop-oss/droplet": "3.5.0", "@headlessui/vue": "^1.7.23", "@heroicons/vue": "^2.1.5", "@lobomfz/prismark": "0.0.3", diff --git a/pages/account/notifications.vue b/pages/account/notifications.vue index f625ab4..04b83f1 100644 --- a/pages/account/notifications.vue +++ b/pages/account/notifications.vue @@ -1,20 +1,32 @@