Fix navigation issue

This commit is contained in:
Roberto Jimenez Sanchez
2025-03-12 10:28:26 +01:00
parent 3cd3227089
commit ca7761a79f
@@ -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) => {