From b06ee9916062865098485429670ff840f5a795eb Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Tue, 29 Oct 2024 08:34:45 +0300 Subject: [PATCH] fix: fix not refetching on update --- src/components/Notifications/SilenceNotificationsList.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Notifications/SilenceNotificationsList.tsx b/src/components/Notifications/SilenceNotificationsList.tsx index 35a64836c..369b7a995 100644 --- a/src/components/Notifications/SilenceNotificationsList.tsx +++ b/src/components/Notifications/SilenceNotificationsList.tsx @@ -235,7 +235,7 @@ export default function SilenceNotificationsList({ const selectedNotificationSilenceId = searchParams.get("id") ?? undefined; - const { data: selectedNotificationSilence } = useQuery({ + const { data: selectedNotificationSilence, refetch } = useQuery({ queryKey: ["notification_silences", selectedNotificationSilenceId], enabled: !!selectedNotificationSilenceId, queryFn: async () => @@ -264,9 +264,11 @@ export default function SilenceNotificationsList({ searchParams.delete("id"); setSearchParams(searchParams); refresh(); + refetch(); }} onClose={() => { searchParams.delete("id"); + refetch(); setSearchParams(searchParams); }} data={selectedNotificationSilence}