From 4bdb77287866c47f5b61d6472b3ff9cc4020f35e Mon Sep 17 00:00:00 2001 From: Wolfboy248 <121288977+Wolfboy248@users.noreply.github.com> Date: Thu, 11 Jul 2024 19:22:00 +0200 Subject: fix: about page crash, update packages (#181) --- frontend/src/components/login.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'frontend/src/components/login.js') diff --git a/frontend/src/components/login.js b/frontend/src/components/login.js index 2b735cb..f86ad44 100644 --- a/frontend/src/components/login.js +++ b/frontend/src/components/login.js @@ -23,7 +23,11 @@ const [isLoggedIn, setIsLoggedIn] = React.useState(false); React.useEffect(() => { fetch(`https://lp.ardapektezol.com/api/v1/token`) .then(r => r.json()) - .then(d => setToken(d.data.token)) + .then(d => { + if (d.data != null) { + setToken(d.data.token) + } + }) }, []); -- cgit v1.2.3