Skip to content

Commit 0f4771a

Browse files
committed
if you hit the settings page wait to see if logged in before redirecting to landing page
1 parent e79b374 commit 0f4771a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/packages/frontend/account/account-page.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { AntdTabItem, Col, Row, Tabs } from "@cocalc/frontend/antd-bootstrap";
1818
import {
1919
React,
2020
redux,
21+
useIsMountedRef,
2122
useTypedRedux,
2223
useWindowDimensions,
2324
} from "@cocalc/frontend/app-framework";
@@ -257,9 +258,17 @@ export const AccountPage: React.FC = () => {
257258
};
258259

259260
function RedirectToNextApp({}) {
261+
const isMountedRef = useIsMountedRef();
262+
260263
useEffect(() => {
261-
window.location.href = appBasePath;
264+
const f = () => {
265+
if (isMountedRef.current) {
266+
// didn't get signed in so go to landing page
267+
window.location.href = appBasePath;
268+
}
269+
};
270+
setTimeout(f, 5000);
262271
}, []);
263272

264-
return null;
273+
return <Loading theme="medium" />;
265274
}

0 commit comments

Comments
 (0)