Skip to content

Commit f776bd6

Browse files
committed
/summary toimii myös dbsetupin aikana
1 parent bd26b83 commit f776bd6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

frontend/src/App.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ const App = () => {
5858
width: '300px',
5959
}
6060

61-
// Always allow access to admin page, regardless of database status
62-
const isAdminRoute = window.location.pathname === "/admin"
61+
const isExemptRoute = () => {
62+
const path = window.location.pathname
63+
return path === "/admin" ||
64+
path === "/summary"
65+
}
6366

6467
const checkDbStatus = useCallback(async () => {
65-
// Don't continuously check database status if on admin page
66-
if (isAdminRoute) {
68+
if (isExemptRoute()) {
6769
setAppReady(true)
6870
return
6971
}
@@ -80,13 +82,13 @@ const App = () => {
8082
checkDbStatus()
8183
}, 1000)
8284
}
83-
}, [isAdminRoute])
85+
}, [])
8486

8587
useEffect(() => {
8688
checkDbStatus()
8789
}, [checkDbStatus])
8890

89-
if (appReady || isAdminRoute) {
91+
if (appReady || isExemptRoute()) {
9092
return (
9193
<Router>
9294
<div>

0 commit comments

Comments
 (0)