fix(home): allow non-admins [EE-4873] (#8297)

pull/8308/head
Chaim Lev-Ari 2023-01-12 15:01:52 +02:00 committed by GitHub
parent 4bdf30c038
commit 329e8bcad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -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;