From ca7761a79fb7edc46baa8d0efadb6b8608357a18 Mon Sep 17 00:00:00 2001 From: Roberto Jimenez Sanchez Date: Wed, 12 Mar 2025 10:28:26 +0100 Subject: [PATCH] Fix navigation issue --- public/app/features/provisioning/Wizard/WizardContent.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/app/features/provisioning/Wizard/WizardContent.tsx b/public/app/features/provisioning/Wizard/WizardContent.tsx index b3f41daa51b..bb9f654ad23 100644 --- a/public/app/features/provisioning/Wizard/WizardContent.tsx +++ b/public/app/features/provisioning/Wizard/WizardContent.tsx @@ -112,7 +112,8 @@ export function WizardContent({ const formData = getValues(); const spec = dataToSpec(formData.repository); await submitData(spec); - // Don't navigate here - let the useEffect handle it + // Navigate after successful save + handleNext(); } catch (error) { console.error('Repository connection failed:', error); handleStatusChange(false); @@ -141,14 +142,12 @@ export function WizardContent({ type: AppEvents.alertSuccess.name, payload: ['Repository saved'], }); - // Move to next step after successful save handleStatusChange(true); - handleNext(); } } else if (saveRequest.isError) { handleStatusChange(false); } - }, [saveRequest.isSuccess, saveRequest.isError, saveRequest.data, setValue, handleStatusChange, handleNext]); + }, [saveRequest.isSuccess, saveRequest.isError, saveRequest.data, setValue, handleStatusChange]); // Helper to check if current step needs job status const isJobStep = (step: string) => {