fix: Do not cache background request for mediasources (#1602)

This commit is contained in:
lostb1t
2026-05-30 09:11:59 +02:00
committed by GitHub
parent cf91c4c682
commit 07b79de203
3 changed files with 14 additions and 4 deletions

View File

@@ -12,11 +12,17 @@ export const excludeFields = (fieldsToExclude: ItemFields[]) => {
);
};
type ExtraQueryOptions = {
gcTime?: number;
staleTime?: number;
};
export const useItemQuery = (
itemId: string | undefined,
isOffline?: boolean,
fields?: ItemFields[],
excludeFields?: ItemFields[],
queryOptions?: ExtraQueryOptions,
) => {
const [api] = useAtom(apiAtom);
const [user] = useAtom(userAtom);
@@ -53,5 +59,6 @@ export const useItemQuery = (
refetchOnWindowFocus: true,
refetchOnReconnect: true,
networkMode: "always",
...queryOptions,
});
};