From 54644efbfd97aedbc3d86063cdc3ed3f0c7d9b5a Mon Sep 17 00:00:00 2001 From: Chandrasekaran Akash Date: Sun, 22 Mar 2026 14:04:04 +0800 Subject: [PATCH] fix(ui): refresh swr caches properly --- src/ui/app/lib/state.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ui/app/lib/state.ts b/src/ui/app/lib/state.ts index 48bf7d66..2c51beee 100644 --- a/src/ui/app/lib/state.ts +++ b/src/ui/app/lib/state.ts @@ -31,6 +31,10 @@ import { create } from "zustand"; const REFRESH_GAP_MS = 60_000; +async function revalidateAllSwrCaches() { + await mutate(() => true, undefined); +} + export async function initState() { const theme = getTheme(); @@ -63,8 +67,7 @@ export function createRefreshTimer(gapMs: number) { export async function refresh() { const now = DateTime.now(); - // Refresh every SWR cache - await mutate(() => true); + await revalidateAllSwrCaches(); const options = { now: dateTimeToTicks(now) }; const [apps, tags, alerts] = await Promise.all([ @@ -102,8 +105,7 @@ async function refreshParts( if (refreshAlerts) obj.alerts = alerts; set(obj); - // Refresh every SWR cache - await mutate(() => true); + await revalidateAllSwrCaches(); } export const untagged: Tag = {