Skip to content

Commit fac2c2b

Browse files
committed
code refactoring
1 parent 781fa73 commit fac2c2b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/App.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ export default function App() {
126126
}
127127

128128
useEffect(() => {
129-
130129
// If not K8S_CLIENT then validateToken otherwise directly redirect
131130
if (!window._env_.K8S_CLIENT) {
132131
// Pass validation for direct email approval notification
@@ -236,16 +235,17 @@ export default function App() {
236235
<Route
237236
exact
238237
path={`${approvalType?.toLocaleLowerCase()}/approve?token=${approvalToken}`}
239-
render={() => GenericDirectApprovalModal && <GenericDirectApprovalModal approvalType={approvalType} />}
238+
render={() =>
239+
GenericDirectApprovalModal && <GenericDirectApprovalModal approvalType={approvalType} />
240+
}
240241
/>
241242
)
242243
} else {
243244
return (
244245
<>
246+
{!window._env_.K8S_CLIENT && <Route path={`/login`} component={Login} />}
245247
<Route path="/" render={() => <NavigationRoutes />} />
246-
<Redirect
247-
to={window._env_.K8S_CLIENT ? '/' : `${URLS.LOGIN_SSO}${location.search}`}
248-
/>
248+
<Redirect to={window._env_.K8S_CLIENT ? '/' : `${URLS.LOGIN_SSO}${location.search}`} />
249249
</>
250250
)
251251
}
@@ -267,7 +267,6 @@ export default function App() {
267267
<ErrorBoundary>
268268
<BreadcrumbStore>
269269
<Switch>
270-
{!window._env_.K8S_CLIENT && <Route path={`/login`} component={Login} />}
271270
{/* <Route
272271
exact
273272
path={`${approvalType?.toLocaleLowerCase()}/approve?token=${approvalToken}`}

0 commit comments

Comments
 (0)