diff --git a/app/react/portainer/HomeView/EnvironmentList/AMTButton/AMTButton.tsx b/app/react/portainer/HomeView/EnvironmentList/AMTButton/AMTButton.tsx index 02c68a193..d66ce2191 100644 --- a/app/react/portainer/HomeView/EnvironmentList/AMTButton/AMTButton.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/AMTButton/AMTButton.tsx @@ -2,7 +2,7 @@ import { Link } from 'lucide-react'; import { useState } from 'react'; import { Environment } from '@/react/portainer/environments/types'; -import { useSettings } from '@/react/portainer/settings/queries'; +import { usePublicSettings } from '@/react/portainer/settings/queries'; import { Query } from '@/react/portainer/environments/queries/useEnvironmentList'; import { isEdgeEnvironment } from '@/react/portainer/environments/utils'; @@ -18,11 +18,10 @@ export function AMTButton({ envQueryParams: Query; }) { const [isOpenDialog, setOpenDialog] = useState(false); - const isOpenAmtEnabledQuery = useSettings( - (settings) => - settings.EnableEdgeComputeFeatures && - settings.openAMTConfiguration.enabled - ); + const isOpenAmtEnabledQuery = usePublicSettings({ + select: (settings) => + settings.EnableEdgeComputeFeatures && settings.IsAMTEnabled, + }); const isOpenAMTEnabled = !!isOpenAmtEnabledQuery.data;