diff --git a/frontend/src/container/Home/Home.tsx b/frontend/src/container/Home/Home.tsx index 56257021e5..f1b4c32b12 100644 --- a/frontend/src/container/Home/Home.tsx +++ b/frontend/src/container/Home/Home.tsx @@ -15,7 +15,6 @@ import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder'; import { REACT_QUERY_KEY } from 'constants/reactQueryKeys'; import ROUTES from 'constants/routes'; import { getHostListsQuery } from 'container/InfraMonitoringHosts/utils'; -import { useGetDeploymentsData } from 'hooks/CustomDomain/useGetDeploymentsData'; import { useGetHostList } from 'hooks/infraMonitoring/useGetHostList'; import { useGetK8sPodsList } from 'hooks/infraMonitoring/useGetK8sPodsList'; import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange'; @@ -29,7 +28,6 @@ import Card from 'periscope/components/Card/Card'; import { useAppContext } from 'providers/App/App'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { useMutation, useQuery } from 'react-query'; -import { LicensePlatform } from 'types/api/licensesV3/getActive'; import { DataSource } from 'types/common/queryBuilder'; import { UserPreference } from 'types/reducer/app'; import { USER_ROLES } from 'types/roles'; @@ -303,19 +301,7 @@ export default function Home(): JSX.Element { } }, [hostData, k8sPodsData, handleUpdateChecklistDoneItem]); - const { activeLicense, isFetchingActiveLicense } = useAppContext(); - - const [isEnabled, setIsEnabled] = useState(false); - - useEffect(() => { - if (isFetchingActiveLicense) { - setIsEnabled(false); - return; - } - setIsEnabled(Boolean(activeLicense?.platform === LicensePlatform.CLOUD)); - }, [activeLicense, isFetchingActiveLicense]); - - const { data: deploymentsData } = useGetDeploymentsData(isEnabled); + const { isCloudUser, isEnterpriseSelfHostedUser } = useGetTenantLicense(); useEffect(() => { logEvent('Homepage: Visited', {}); @@ -701,7 +687,7 @@ export default function Home(): JSX.Element { )}