Invalidate swr when clearing cache
This commit is contained in:
parent
bd0f61f237
commit
730f7f07ee
@ -2,13 +2,17 @@
|
||||
|
||||
import SubmitButtonWithStatus from '@/components/SubmitButtonWithStatus';
|
||||
import { syncCacheAction } from '@/photo/actions';
|
||||
import { useAppState } from '@/state/AppState';
|
||||
import { BiTrash } from 'react-icons/bi';
|
||||
|
||||
export default function ClearCacheButton() {
|
||||
const { invalidateSwr } = useAppState();
|
||||
|
||||
return (
|
||||
<form action={syncCacheAction}>
|
||||
<SubmitButtonWithStatus
|
||||
icon={<BiTrash />}
|
||||
onFormSubmit={invalidateSwr}
|
||||
>
|
||||
Clear Cache
|
||||
</SubmitButtonWithStatus>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user