diff --git a/frontend/src/container/OnboardingContainer/OnboardingContainer.tsx b/frontend/src/container/OnboardingContainer/OnboardingContainer.tsx index 3129d76c8e..c1275ff115 100644 --- a/frontend/src/container/OnboardingContainer/OnboardingContainer.tsx +++ b/frontend/src/container/OnboardingContainer/OnboardingContainer.tsx @@ -247,8 +247,7 @@ export default function Onboarding(): JSX.Element { const handleNext = (): void => { if (activeStep <= 3) { - handleNextStep(); - history.replace(moduleRouteMap[selectedModule.id as ModulesMap]); + history.push(moduleRouteMap[selectedModule.id as ModulesMap]); } }; @@ -258,6 +257,13 @@ export default function Onboarding(): JSX.Element { updateSelectedDataSource(null); }; + const handleBackNavigation = (): void => { + setCurrent(0); + setActiveStep(1); + setSelectedModule(useCases.APM); + resetProgress(); + }; + useEffect(() => { const { pathname } = location; @@ -277,9 +283,11 @@ export default function Onboarding(): JSX.Element { } else if (pathname === ROUTES.GET_STARTED_AZURE_MONITORING) { handleModuleSelect(useCases.AzureMonitoring); handleNextStep(); + } else { + handleBackNavigation(); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [location.pathname]); const [form] = Form.useForm(); const [