fix(widgets): refetch after render errors (#6399)

Remove incompatible persisted widget query data before resetting a crashed widget so it can fetch fresh data instead of re-rendering the same stale payload.
This commit is contained in:
Clarkar00 authored and GitHub committed 2026-07-28 23:12:03 +02:00
1 parent 489980814c
commit ac73b9d891
3 files changed
+63 -1

No files matched your search

@@ -0,0 +1,7 @@
import type { QueryClient } from "@tanstack/react-query";
import { isPersistableWidgetQueryKey } from "@homarr/api/query-cache";
export const removePersistedWidgetQueries = (queryClient: QueryClient) => {
queryClient.removeQueries({ predicate: (query) => isPersistableWidgetQueryKey(query.queryKey) });
};