diff --git a/x-pack/plugins/observability/public/pages/home/index.test.tsx b/x-pack/plugins/observability/public/pages/home/index.test.tsx index 755757ea9dc87..a2c784cb4b2de 100644 --- a/x-pack/plugins/observability/public/pages/home/index.test.tsx +++ b/x-pack/plugins/observability/public/pages/home/index.test.tsx @@ -14,7 +14,7 @@ import { HomePage } from './'; const mockHistoryPush = jest.fn(); jest.mock('react-router-dom', () => ({ useHistory: () => ({ - push: mockHistoryPush, + replace: mockHistoryPush, }), })); diff --git a/x-pack/plugins/observability/public/pages/home/index.tsx b/x-pack/plugins/observability/public/pages/home/index.tsx index e5d22fac918ad..9e7fe99e3f780 100644 --- a/x-pack/plugins/observability/public/pages/home/index.tsx +++ b/x-pack/plugins/observability/public/pages/home/index.tsx @@ -16,9 +16,9 @@ export function HomePage() { useEffect(() => { if (hasAnyData === true) { - history.push({ pathname: '/overview' }); + history.replace({ pathname: '/overview' }); } else if (hasAnyData === false && isAllRequestsComplete === true) { - history.push({ pathname: '/landing' }); + history.replace({ pathname: '/landing' }); } }, [hasAnyData, isAllRequestsComplete, history]);