oops
This commit is contained in:
parent
4b820ba231
commit
9c2c547c13
20
src/App.tsx
20
src/App.tsx
|
@ -38,15 +38,17 @@ function App(props: RouteComponentProps) {
|
||||||
const { setUser } = useUser();
|
const { setUser } = useUser();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
ReactGA.pageview(window.location.pathname);
|
ReactGA.pageview(window.location.pathname);
|
||||||
fetch("https://account.lingdocs.com/api/user").then((res) => res.json()).then((res) => {
|
fetch("https://account.lingdocs.com/api/user", { credentials: "include" })
|
||||||
console.log("fetched user info");
|
.then((res) => res.json())
|
||||||
if (res.user) {
|
.then((res) => {
|
||||||
const user = res.user as AT.LingdocsUser
|
console.log("fetched user info");
|
||||||
setUser(user);
|
if (res.user) {
|
||||||
} else {
|
const user = res.user as AT.LingdocsUser
|
||||||
setUser(undefined);
|
setUser(user);
|
||||||
}
|
} else {
|
||||||
}).catch(console.error);
|
setUser(undefined);
|
||||||
|
}
|
||||||
|
}).catch(console.error);
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
Loading…
Reference in New Issue