[Fleet] Fix logic for detecting first time Elastic Agent users (#182214)

## Summary

Resolves https://github.com/elastic/kibana/issues/181800. Fixes the
logic for detecting first time Elastic Agent users on Cloud so that the
multi-page layout for adding an integration kicks in.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Jen Huang 2024-05-01 10:47:53 -07:00 committed by GitHub
parent 1e8d51ae51
commit 63bc11a02b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,6 +51,6 @@ export const useIsFirstTimeAgentUserQuery = (): UseIsFirstTimeAgentUserResponse
return {
isLoading: authz.fleet.readAgentPolicies && (areAgentPoliciesLoading || areAgentsLoading),
isFirstTimeAgentUser: !authz.fleet.readAgentPolicies && agents?.data?.total === 0,
isFirstTimeAgentUser: authz.fleet.readAgentPolicies && agents?.data?.total === 0,
};
};