From 0c0973195dca47b1c1331425307d4396d8f17edb Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Mon, 4 Aug 2025 21:42:41 -0600 Subject: [PATCH] Update useGetAsset.tsx --- .../AppAssetCheckLayout/useGetAsset.tsx | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/web/src/layouts/AppAssetCheckLayout/useGetAsset.tsx b/apps/web/src/layouts/AppAssetCheckLayout/useGetAsset.tsx index 937547bce..9a4379887 100644 --- a/apps/web/src/layouts/AppAssetCheckLayout/useGetAsset.tsx +++ b/apps/web/src/layouts/AppAssetCheckLayout/useGetAsset.tsx @@ -118,6 +118,18 @@ export const useGetAsset = ( { enabled: isDashboard, select: (x) => x?.dashboard?.name, staleTime: Infinity } ); + const { + isFetched: reportIsFetched, + error: reportError, + isError: reportIsError, + data: reportTitle + } = useGetReport( + { reportId: isReport ? props.assetId : undefined, versionNumber }, + { + select: (x) => x?.name + } + ); + const { isFetched: collectionIsFetched, error: collectionError, @@ -127,15 +139,6 @@ export const useGetAsset = ( select: (x) => x?.name }); - const { - isFetched: reportIsFetched, - error: reportError, - isError: reportIsError, - data: reportTitle - } = useGetReport(isReport ? props.assetId : undefined, { - select: (x) => x?.name - }); - const currentQuery = useMemo((): AssetQueryResult => { switch (props.type) { case 'metric':