diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx index a62c76882b2a1..2d776dc8d15d1 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx @@ -96,7 +96,6 @@ const ApiKeyField: React.FunctionComponent<{ apiKeyId: string }> = ({ apiKeyId } }) } color="text" - isDisabled={state === 'LOADING'} onClick={toggleKey} iconType={state === 'VISIBLE' ? 'eyeClosed' : 'eye'} /> @@ -269,6 +268,10 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => { }, ]; + const isLoading = + (enrollmentAPIKeysRequest.isLoading && enrollmentAPIKeysRequest.isInitialRequest) || + (agentPoliciesRequest.isLoading && agentPoliciesRequest.isInitialRequest); + return ( {isModalOpen && ( @@ -312,10 +315,10 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => { - loading={enrollmentAPIKeysRequest.isLoading && enrollmentAPIKeysRequest.isInitialRequest} + loading={isLoading} hasActions={true} noItemsMessage={ - enrollmentAPIKeysRequest.isLoading && enrollmentAPIKeysRequest.isInitialRequest ? ( + isLoading ? (