Fix : Do not render the slack chat component directly as child of router switch (#9166)

This commit is contained in:
Sachin Chaurasiya 2022-12-06 15:34:01 +05:30 committed by GitHub
parent d2fdb47f22
commit 24ff5562db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,42 +137,48 @@ const AppRouter = () => {
}
return (
<Switch>
<>
{slackChat}
<Route exact component={SigninPage} path={ROUTES.SIGNIN} />
{callbackComponent ? (
<Route component={callbackComponent} path={ROUTES.CALLBACK} />
) : null}
<Switch>
<Route exact component={SigninPage} path={ROUTES.SIGNIN} />
{callbackComponent ? (
<Route component={callbackComponent} path={ROUTES.CALLBACK} />
) : null}
<Route exact path={ROUTES.HOME}>
{!isAuthenticated && !isSigningIn ? (
<Route exact path={ROUTES.HOME}>
{!isAuthenticated && !isSigningIn ? (
<>
<Redirect to={ROUTES.SIGNIN} />
</>
) : (
<Redirect to={ROUTES.MY_DATA} />
)}
</Route>
{isBasicAuthProvider && (
<>
<Redirect to={ROUTES.SIGNIN} />
<Route exact component={BasicSignupPage} path={ROUTES.REGISTER} />
<Route
exact
component={ForgotPassword}
path={ROUTES.FORGOT_PASSWORD}
/>
<Route
exact
component={ResetPassword}
path={ROUTES.RESET_PASSWORD}
/>
<Route
exact
component={AccountActivationConfirmation}
path={ROUTES.ACCOUNT_ACTIVATION}
/>
</>
) : (
<Redirect to={ROUTES.MY_DATA} />
)}
</Route>
{isBasicAuthProvider && (
<>
<Route exact component={BasicSignupPage} path={ROUTES.REGISTER} />
<Route
exact
component={ForgotPassword}
path={ROUTES.FORGOT_PASSWORD}
/>
<Route exact component={ResetPassword} path={ROUTES.RESET_PASSWORD} />
<Route
exact
component={AccountActivationConfirmation}
path={ROUTES.ACCOUNT_ACTIVATION}
/>
</>
)}
{isAuthenticated && <AuthenticatedAppRouter />}
<Route exact component={PageNotFound} path={ROUTES.NOT_FOUND} />
</Switch>
{isAuthenticated && <AuthenticatedAppRouter />}
<Route exact component={PageNotFound} path={ROUTES.NOT_FOUND} />
</Switch>
</>
);
};