fix isLoadedRundown the now rundown id is provided

This commit is contained in:
alex-arc
2026-07-26 16:33:05 +02:00
parent 535717fa90
commit 99a2f58502
@@ -30,8 +30,8 @@ export function useRundown(rundownId: Maybe<string>) {
data: { loaded: loadedRundownId }, data: { loaded: loadedRundownId },
} = useProjectRundowns(); } = useProjectRundowns();
const effectiveRundownId = rundownId ? rundownId : loadedRundownId; const effectiveRundownId = rundownId !== null ? rundownId : loadedRundownId;
const isLoadedRundown = rundownId === loadedRundownId; const isLoadedRundown = effectiveRundownId === loadedRundownId;
const { data, status, isError, refetch, isFetching } = useQuery<Rundown>({ const { data, status, isError, refetch, isFetching } = useQuery<Rundown>({
queryKey: getRundownQueryKey(effectiveRundownId), queryKey: getRundownQueryKey(effectiveRundownId),
@@ -43,9 +43,6 @@ export function useRundown(rundownId: Maybe<string>) {
return { data: data ?? cachedRundownPlaceholder, status, isError, refetch, isFetching, isLoadedRundown }; return { data: data ?? cachedRundownPlaceholder, status, isError, refetch, isFetching, isLoadedRundown };
} }
/**
* @deprecated
*/
export function useRundownWithMetadata(rundownId: Maybe<string>) { export function useRundownWithMetadata(rundownId: Maybe<string>) {
'use memo'; 'use memo';