mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 02:05:28 +00:00
fix: pre-emptive render without valid user
This commit is contained in:
@@ -13,7 +13,7 @@ interface Props {
|
|||||||
export const CheckAuth = (props: Props) => {
|
export const CheckAuth = (props: Props) => {
|
||||||
const auth = useApplicationState().auth;
|
const auth = useApplicationState().auth;
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
const ready = auth.isLoggedIn() && typeof client?.user !== "undefined";
|
const ready = auth.isLoggedIn() && !!client?.user;
|
||||||
|
|
||||||
if (props.auth && !ready) {
|
if (props.auth && !ready) {
|
||||||
return <Redirect to="/login" />;
|
return <Redirect to="/login" />;
|
||||||
|
|||||||
Reference in New Issue
Block a user