From 730f7f07eeb4e5bf2e846582486d1ce37ec2c1ae Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sat, 27 Apr 2024 13:02:57 -0500 Subject: [PATCH] Invalidate swr when clearing cache --- src/admin/ClearCacheButton.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/admin/ClearCacheButton.tsx b/src/admin/ClearCacheButton.tsx index 7f981ff9..794a88dd 100644 --- a/src/admin/ClearCacheButton.tsx +++ b/src/admin/ClearCacheButton.tsx @@ -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 (
} + onFormSubmit={invalidateSwr} > Clear Cache