Skip to content

Commit 781fa73

Browse files
committed
navigation
1 parent 6922e0b commit 781fa73

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

src/App.tsx

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,27 @@ export default function App() {
230230
}
231231
}, [bgUpdated])
232232

233+
const renderFirstNavigatedPage = () => {
234+
if (location.pathname && location.pathname.includes('approve')) {
235+
return (
236+
<Route
237+
exact
238+
path={`${approvalType?.toLocaleLowerCase()}/approve?token=${approvalToken}`}
239+
render={() => GenericDirectApprovalModal && <GenericDirectApprovalModal approvalType={approvalType} />}
240+
/>
241+
)
242+
} else {
243+
return (
244+
<>
245+
<Route path="/" render={() => <NavigationRoutes />} />
246+
<Redirect
247+
to={window._env_.K8S_CLIENT ? '/' : `${URLS.LOGIN_SSO}${location.search}`}
248+
/>
249+
</>
250+
)
251+
}
252+
}
253+
233254
return (
234255
<Suspense fallback={null}>
235256
{validating ? (
@@ -247,19 +268,20 @@ export default function App() {
247268
<BreadcrumbStore>
248269
<Switch>
249270
{!window._env_.K8S_CLIENT && <Route path={`/login`} component={Login} />}
250-
<Route exact path="/" render={() => <NavigationRoutes />} />
251-
<Route
271+
{/* <Route
252272
exact
253273
path={`${approvalType?.toLocaleLowerCase()}/approve?token=${approvalToken}`}
254274
render={() =>
255275
GenericDirectApprovalModal && (
256276
<GenericDirectApprovalModal approvalType={approvalType} />
257277
)
258278
}
259-
/>
279+
/> */}
280+
{/* <Route path="/" render={() => <NavigationRoutes />} />
260281
<Redirect
261282
to={window._env_.K8S_CLIENT ? '/' : `${URLS.LOGIN_SSO}${location.search}`}
262-
/>
283+
/> */}
284+
{renderFirstNavigatedPage()}
263285
</Switch>
264286
<div id="full-screen-modal"></div>
265287
<div id="visible-modal"></div>

0 commit comments

Comments
 (0)