fix: ensure we dont bloat notification table with any other notification than app
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useAppParams } from '@/hooks/useAppParams';
|
||||
import useWS from '@/hooks/useWS';
|
||||
import type { Notification } from '@openpanel/db';
|
||||
import type { Prisma } from '@openpanel/db';
|
||||
import { BellIcon } from 'lucide-react';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
@@ -15,12 +15,15 @@ export function NotificationProvider() {
|
||||
export function InnerNotificationProvider({
|
||||
projectId,
|
||||
}: { projectId: string }) {
|
||||
useWS<Notification>(`/live/notifications/${projectId}`, (notification) => {
|
||||
toast(notification.title, {
|
||||
description: notification.message,
|
||||
icon: <BellIcon className="size-4" />,
|
||||
});
|
||||
});
|
||||
useWS<Prisma.NotificationUncheckedCreateInput>(
|
||||
`/live/notifications/${projectId}`,
|
||||
(notification) => {
|
||||
toast(notification.title, {
|
||||
description: notification.message,
|
||||
icon: <BellIcon className="size-4" />,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -46,14 +46,6 @@ export function useColumns() {
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: 'integration',
|
||||
header: 'Integration',
|
||||
cell({ row }) {
|
||||
const integration = row.original.integration;
|
||||
return <div>{integration?.name}</div>;
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: 'notificationRule',
|
||||
header: 'Rule',
|
||||
|
||||
Reference in New Issue
Block a user