From 3db5ccc86d8a6a8f6263490579cf9d1ebd0d4583 Mon Sep 17 00:00:00 2001 From: Jag <77469789+jag3dagster@users.noreply.github.com> Date: Fri, 26 Aug 2022 09:37:28 -0700 Subject: [PATCH] fix(notification): Notification id now works as documentation states (#78) * `id` was being checked for but never got set on the toast so you'd continue to get duplicate messages even if `id` was set --- web/src/features/notifications/NotificationWrapper.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/features/notifications/NotificationWrapper.tsx b/web/src/features/notifications/NotificationWrapper.tsx index f25fb72..3b9499c 100644 --- a/web/src/features/notifications/NotificationWrapper.tsx +++ b/web/src/features/notifications/NotificationWrapper.tsx @@ -71,7 +71,9 @@ const Notifications: React.FC = () => { : "circle-info"; } + const id = data.id toast({ + id, duration: data.duration || 3000, position: data.position || "top-right", render: () => ( @@ -105,7 +107,9 @@ const Notifications: React.FC = () => { useNuiEvent("notify", (data) => { if (!data.title && !data.description) return; if (data.id && toast.isActive(data.id)) return; + const id = data.id toast({ + id, title: data.title, description: data.description, duration: data.duration || 4000,