Skip to content

Commit

Permalink
🐛 Invalidate mod event list query when new event is emitted (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
foysalit authored Feb 12, 2024
1 parent 266be36 commit 6b5e8f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 4 additions & 2 deletions app/actions/ModActionPanel/QuickAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
<p className="pb-4 text-center text-gray-400 dark:text-gray-50">No reports found</p>
<p className="pb-4 text-center text-gray-400 dark:text-gray-50">
No reports found
</p>
</>
)}
</div>
Expand Down Expand Up @@ -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()
Expand Down
5 changes: 1 addition & 4 deletions components/reports/ReportPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 6b5e8f9

Please sign in to comment.