mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-07 15:29:10 +00:00
fix isLoadedRundown the now rundown id is provided
This commit is contained in:
@@ -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';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user