Skip to content

Commit f52a06a

Browse files
committed
fix(indexd): invalidate alerts cache on dismiss
1 parent cc04509 commit f52a06a

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.changeset/clear-files-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@siafoundation/indexd-react': minor
3+
---
4+
5+
Fixed dismissed alerts not disappearing from the list until browser refresh. Closes https://github.com/SiaFoundation/indexd/issues/726

libs/indexd-react/src/admin.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,17 @@ export function useAdminAlertsDismiss(
577577
AdminAlertsDismissResponse
578578
>,
579579
) {
580-
return usePostFunc({
581-
...args,
582-
route: adminAlertsDismissRoute,
583-
})
580+
return usePostFunc(
581+
{
582+
...args,
583+
route: adminAlertsDismissRoute,
584+
},
585+
async (mutate) => {
586+
mutate((key) => {
587+
return key.startsWith(adminAlertsRoute)
588+
})
589+
}
590+
)
584591
}
585592

586593
// stats

0 commit comments

Comments
 (0)