From 7827a2aedddd72ee9fde682e11a64ec6ed7e86f0 Mon Sep 17 00:00:00 2001 From: Keith Grant Date: Thu, 9 Apr 2020 16:07:06 -0700 Subject: [PATCH] fix double-fetch of cred types in launch prompts --- awx/ui_next/src/components/LaunchPrompt/CredentialsStep.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/awx/ui_next/src/components/LaunchPrompt/CredentialsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/CredentialsStep.jsx index f86513a550..a389db0cff 100644 --- a/awx/ui_next/src/components/LaunchPrompt/CredentialsStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/CredentialsStep.jsx @@ -24,7 +24,6 @@ function CredentialsStep({ i18n }) { const [selectedType, setSelectedType] = useState(null); const history = useHistory(); - const isTypeSelected = !!selectedType; const { result: types, error: typesError, @@ -33,13 +32,13 @@ function CredentialsStep({ i18n }) { } = useRequest( useCallback(async () => { const loadedTypes = await CredentialTypesAPI.loadAllTypes(); - if (!isTypeSelected && loadedTypes.length) { + if (loadedTypes.length) { const match = loadedTypes.find(type => type.kind === 'ssh') || loadedTypes[0]; setSelectedType(match); } return loadedTypes; - }, [isTypeSelected]), + }, []), [] );