From 57509c134b4d693cfd9ab72e60b45f6530415580 Mon Sep 17 00:00:00 2001 From: Christian Carlsson Date: Thu, 28 Nov 2024 10:46:32 +0000 Subject: [PATCH 1/5] checkpoint --- web/src/ui/components/NavigationMobile.vue | 2 +- web/src/ui/components/NotificationWorkoutComment.vue | 5 +++-- web/src/utils/datetime.ts | 7 +++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/src/ui/components/NavigationMobile.vue b/web/src/ui/components/NavigationMobile.vue index 5ab68d85..7903dd5e 100644 --- a/web/src/ui/components/NavigationMobile.vue +++ b/web/src/ui/components/NavigationMobile.vue @@ -72,7 +72,7 @@ onMounted(() => { class="h-6 w-6" /> {{ unreadCount }} diff --git a/web/src/ui/components/NotificationWorkoutComment.vue b/web/src/ui/components/NotificationWorkoutComment.vue index c28bfa30..7c91c78a 100644 --- a/web/src/ui/components/NotificationWorkoutComment.vue +++ b/web/src/ui/components/NotificationWorkoutComment.vue @@ -1,6 +1,7 @@ diff --git a/web/src/ui/notifications/ListNotifications.vue b/web/src/ui/notifications/ListNotifications.vue index 5083637d..9ddcfff1 100644 --- a/web/src/ui/notifications/ListNotifications.vue +++ b/web/src/ui/notifications/ListNotifications.vue @@ -4,11 +4,13 @@ import type { PaginationRequest } from '@/proto/api/v1/shared_pb.ts' import { onMounted, ref } from 'vue' import { create } from '@bufbuild/protobuf' import { UserClient } from '@/clients/clients.ts' +import { useNotificationStore } from '@/stores/notifications.ts' import NotificationWorkoutComment from '@/ui/components/NotificationWorkoutComment.vue' import { ListNotificationsRequestSchema, type Notification } from '@/proto/api/v1/users_pb.ts' const notifications = ref([] as Notification[]) const pageToken = ref(new Uint8Array(0)) +const notificationStore = useNotificationStore() const fetchUnreadNotifications = async () => { const req = create(ListNotificationsRequestSchema, { @@ -29,8 +31,9 @@ const fetchUnreadNotifications = async () => { } } -onMounted(() => { - fetchUnreadNotifications() +onMounted(async () => { + await fetchUnreadNotifications() + await notificationStore.fetchUnreadNotifications() })