diff --git a/frontend/src/AppRoutes/Private.tsx b/frontend/src/AppRoutes/Private.tsx index 35c4f11e20..ab46d96a8e 100644 --- a/frontend/src/AppRoutes/Private.tsx +++ b/frontend/src/AppRoutes/Private.tsx @@ -189,7 +189,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element { if (fromPathname) { history.push(fromPathname); setLocalStorageApi(LOCALSTORAGE.UNAUTHENTICATED_ROUTE_HIT, ''); - } else { + } else if (pathname !== ROUTES.SOMETHING_WENT_WRONG) { history.push(ROUTES.APPLICATION); } } else { diff --git a/frontend/src/AppRoutes/index.tsx b/frontend/src/AppRoutes/index.tsx index cd77215682..5875a31d87 100644 --- a/frontend/src/AppRoutes/index.tsx +++ b/frontend/src/AppRoutes/index.tsx @@ -22,7 +22,7 @@ import { IUser } from 'providers/App/types'; import { DashboardProvider } from 'providers/Dashboard/Dashboard'; import { QueryBuilderProvider } from 'providers/QueryBuilder'; import { Suspense, useCallback, useEffect, useState } from 'react'; -import { Redirect, Route, Router, Switch } from 'react-router-dom'; +import { Route, Router, Switch } from 'react-router-dom'; import { CompatRouter } from 'react-router-dom-v5-compat'; import { extractDomain, isCloudUser, isEECloudUser } from 'utils/app'; @@ -240,12 +240,19 @@ function App(): JSX.Element { // if the required calls fails then return a something went wrong error // this needs to be on top of data missing error because if there is an error, data will never be loaded and it will // move to indefinitive loading - if (userFetchError || licensesFetchError) { - return ; + if ( + (userFetchError || licensesFetchError) && + pathname !== ROUTES.SOMETHING_WENT_WRONG + ) { + history.replace(ROUTES.SOMETHING_WENT_WRONG); } // if all of the data is not set then return a spinner, this is required because there is some gap between loading states and data setting - if (!licenses || !user.email || !featureFlags) { + if ( + (!licenses || !user.email || !featureFlags) && + !userFetchError && + !licensesFetchError + ) { return ; } } diff --git a/frontend/src/AppRoutes/pageComponents.ts b/frontend/src/AppRoutes/pageComponents.ts index e623357ab5..fb63e865cb 100644 --- a/frontend/src/AppRoutes/pageComponents.ts +++ b/frontend/src/AppRoutes/pageComponents.ts @@ -180,7 +180,7 @@ export const PasswordReset = Loadable( export const SomethingWentWrong = Loadable( () => import( - /* webpackChunkName: "SomethingWentWrong" */ 'pages/SomethingWentWrong' + /* webpackChunkName: "ErrorBoundaryFallback" */ 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback' ), ); diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/config.ts b/frontend/src/container/TopNav/DateTimeSelectionV2/config.ts index 408ed6c11e..a84e1b2c7e 100644 --- a/frontend/src/container/TopNav/DateTimeSelectionV2/config.ts +++ b/frontend/src/container/TopNav/DateTimeSelectionV2/config.ts @@ -214,6 +214,7 @@ export const routesToSkip = [ ROUTES.MESSAGING_QUEUES, ROUTES.MESSAGING_QUEUES_DETAIL, ROUTES.INFRASTRUCTURE_MONITORING_HOSTS, + ROUTES.SOMETHING_WENT_WRONG, ]; export const routesToDisable = [ROUTES.LOGS_EXPLORER, ROUTES.LIVE_LOGS];