From eb05e0ee333928c8237f1a3bf102f72f7887364b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Sun, 24 Nov 2024 22:01:53 +0100 Subject: [PATCH] fix(dashboard): do not listen to notifications if projectid is missing --- .../components/notifications/notification-provider.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/dashboard/src/components/notifications/notification-provider.tsx b/apps/dashboard/src/components/notifications/notification-provider.tsx index 1e125893..0824ab35 100644 --- a/apps/dashboard/src/components/notifications/notification-provider.tsx +++ b/apps/dashboard/src/components/notifications/notification-provider.tsx @@ -6,6 +6,15 @@ import { toast } from 'sonner'; export function NotificationProvider() { const { projectId } = useAppParams(); + + if (!projectId) return null; + + return ; +} + +export function InnerNotificationProvider({ + projectId, +}: { projectId: string }) { useWS(`/live/notifications/${projectId}`, (notification) => { toast(notification.title, { description: notification.message,