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.
8 lines
310 B
TypeScript
8 lines
310 B
TypeScript
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) });
|
|
};
|