Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Invalidate mod event list query when new event is emitted #28

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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