diff --git a/frontend/src/pages/Login.tsx b/frontend/src/pages/Login.tsx index 9caf27ee..1986cefd 100644 --- a/frontend/src/pages/Login.tsx +++ b/frontend/src/pages/Login.tsx @@ -15,6 +15,7 @@ const Login = () => { const [password, setPassword] = useState(''); const [saveLogin, setSaveLogin] = useState(false); const [waitingForBackend, setWaitingForBackend] = useState(false); + const [waitedCount, setWaitedCount] = useState(0); const [errorMessage, setErrorMessage] = useState(null); const handleSubmit = async (event: { preventDefault: () => void }) => { @@ -40,6 +41,8 @@ const Login = () => { }; useEffect(() => { + let retryCount = 0; + const backendCheckInterval = setInterval(async () => { try { const auth = await loadAuth(); @@ -59,6 +62,8 @@ const Login = () => { } } catch (error) { console.log('Checking backend availability: ', error); + retryCount += 1; + setWaitedCount(retryCount); setWaitingForBackend(true); } }, 1000); @@ -137,6 +142,35 @@ const Login = () => { {!waitingForBackend &&