From e2db1928bb0968548f9f19a573e03c60ed109c84 Mon Sep 17 00:00:00 2001 From: adueck Date: Wed, 5 Oct 2022 12:55:24 +0500 Subject: [PATCH] default to table-of-contents after the user has seen the intro page --- src/App.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 542934e..9053429 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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(() => {