From 848d588bf4fcd1d5ae644edab9fd269a62d48216 Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Fri, 23 Feb 2024 20:02:08 +0000 Subject: [PATCH] Fix Homepage Buttons Loading Slow --- frontend-next/src/app/page.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend-next/src/app/page.js b/frontend-next/src/app/page.js index ba257bf..87cc7d7 100644 --- a/frontend-next/src/app/page.js +++ b/frontend-next/src/app/page.js @@ -4,11 +4,13 @@ import { useState, useEffect } from 'react' function Home() { const [statusCode, setData] = useState(null) + const [isLoading, setLoading] = useState(true) useEffect(() => { fetch('/api/user') .then((res) => res.status) .then((status) => { setData(status) + setLoading(false) }) }, []) return ( @@ -20,7 +22,7 @@ function Home() { Chat with friends!
- {statusCode == 203 && + {(statusCode == 203 || isLoading) &&
-- 2.52.0