dashboard loader state update

This commit is contained in:
Nate Kelley 2025-04-11 09:59:42 -06:00
parent 24d785616c
commit 6596d99a35
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 8 additions and 8 deletions

View File

@ -1,12 +1,8 @@
'use client';
import type { BusterDashboard, BusterDashboardResponse } from '@/api/asset_interfaces/dashboard';
import type { BusterDashboard } from '@/api/asset_interfaces/dashboard';
import { useMount } from '@/hooks';
import { create } from 'zustand';
import { compareObjectsByKeys } from '@/lib/objects';
import { useGetDashboard } from '@/api/buster_rest/dashboards';
import { useMemoizedFn, useMount } from '@/hooks';
import { useQueryClient } from '@tanstack/react-query';
import { dashboardQueryKeys } from '@/api/query_keys/dashboard';
type OriginalDashboardStore = {
originalDashboards: Record<string, BusterDashboard>;

View File

@ -58,7 +58,11 @@ export const useGetAsset = (props: UseGetAssetProps): UseGetAssetReturn<typeof p
);
//dashboard
const { isFetched: isFetchedDashboard, error: errorDashboard } = useGetDashboard(
const {
isFetched: isFetchedDashboard,
error: errorDashboard,
isError: isErrorDashboard
} = useGetDashboard(
{
id: props.type === 'dashboard' ? props.assetId : undefined
},
@ -88,7 +92,7 @@ export const useGetAsset = (props: UseGetAssetProps): UseGetAssetReturn<typeof p
hasAccess,
passwordRequired,
isPublic,
showLoader: isFetchedDashboard || !!errorDashboard
showLoader: !isFetchedDashboard || isErrorDashboard
};
};