From a4970e6d6390422992a7ed41f7c9b69e2aa524dc Mon Sep 17 00:00:00 2001 From: Foysal Ahamed Date: Mon, 12 Feb 2024 22:15:49 +0800 Subject: [PATCH] :bug: Invalidate mod event list query when new event is emitted --- app/actions/ModActionPanel/QuickAction.tsx | 6 ++++-- components/reports/ReportPanel.tsx | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/actions/ModActionPanel/QuickAction.tsx b/app/actions/ModActionPanel/QuickAction.tsx index bb520e231..ee8ff9009 100644 --- a/app/actions/ModActionPanel/QuickAction.tsx +++ b/app/actions/ModActionPanel/QuickAction.tsx @@ -117,7 +117,9 @@ export function ModActionPanelQuick( title="No reports" className="h-10 w-10 text-green-300 align-text-bottom mx-auto mb-4" /> -

No reports found

+

+ No reports found +

)} @@ -359,7 +361,7 @@ function Form( refetchSubjectStatus() refetchSubject() - queryClient.invalidateQueries(['modEventList', { props: { subject } }]) + queryClient.invalidateQueries(['modEventList']) // After successful submission, reset the form state to clear inputs for previous submission ev.target.reset() diff --git a/components/reports/ReportPanel.tsx b/components/reports/ReportPanel.tsx index 61a8b7ac5..a8dcb786c 100644 --- a/components/reports/ReportPanel.tsx +++ b/components/reports/ReportPanel.tsx @@ -65,10 +65,7 @@ function Form(props: { reason: formData.get('reason')!.toString() || undefined, }) onCancel() // Close - queryClient.invalidateQueries([ - 'modEventList', - { props: { subject } }, - ]) + queryClient.invalidateQueries(['modEventList']) } finally { setSubmitting(false) }