default to table-of-contents after the user has seen the intro page

This commit is contained in:
adueck 2022-10-05 12:55:24 +05:00
parent a4a496f0fe
commit e2db1928bb
1 changed files with 7 additions and 0 deletions

View File

@ -44,6 +44,13 @@ function App(props: RouteComponentProps) {
}
useEffect(() => {
logAnalytics();
if (props.location.pathname === "/") {
if (localStorage.getItem("visitedOnce")) {
props.history.replace("/table-of-contents");
} else {
localStorage.setItem("visitedOnce", "true");
}
}
// eslint-disable-next-line
}, []);
useEffect(() => {