diff --git a/components/settings/about-data-settings.tsx b/components/settings/about-data-settings.tsx index 7bbde4a7..0c0556b9 100644 --- a/components/settings/about-data-settings.tsx +++ b/components/settings/about-data-settings.tsx @@ -11,6 +11,7 @@ import { useUpdateStore } from '@/stores/update-store'; import { ExternalLink } from 'lucide-react'; import { cn } from '@/lib/utils'; import { getPathPrefix } from '@/lib/browser-navigation'; +import { clearCachedData } from '@/lib/clear-cached-data'; import { SpamSiegeGame } from './spam-siege-game'; const APP_VERSION = process.env.NEXT_PUBLIC_APP_VERSION || "0.0.0"; @@ -54,6 +55,7 @@ export function AboutDataSettings() { useSettingsStore(); const { settingsSyncEnabled } = useConfig(); const [showResetConfirm, setShowResetConfirm] = useState(false); + const [showRefreshConfirm, setShowRefreshConfirm] = useState(false); const fileInputRef = useRef(null); const { isFeatureEnabled } = usePolicyStore(); const [showGame, setShowGame] = useState(false); @@ -105,6 +107,15 @@ export function AboutDataSettings() { reader.readAsText(file); }; + const handleRefreshCache = () => { + if (showRefreshConfirm) { + clearCachedData(); // reloads the page + } else { + setShowRefreshConfirm(true); + setTimeout(() => setShowRefreshConfirm(false), 5000); + } + }; + const handleReset = () => { if (showResetConfirm) { resetToDefaults(); @@ -187,6 +198,16 @@ export function AboutDataSettings() { )} + + + +