fix: keep login screen visible until store refresh completes

This commit is contained in:
root
2025-11-09 16:29:21 +01:00
parent c77b2e55a0
commit 30e78d7682

View File

@@ -494,13 +494,11 @@ function App() {
}); });
} }
} }
finishSyncProgress();
} catch (err) { } catch (err) {
console.warn('Konnte Session nicht wiederherstellen:', err); console.warn('Konnte Session nicht wiederherstellen:', err);
} finally {
if (ticker) {
clearInterval(ticker);
}
finishSyncProgress(); finishSyncProgress();
} finally {
setInitializing(false); setInitializing(false);
} }
})(); })();
@@ -842,7 +840,16 @@ function App() {
return ( return (
<> <>
<div className="min-h-screen flex items-center justify-center bg-gray-100"> <div className="min-h-screen flex items-center justify-center bg-gray-100">
<form className="bg-white shadow-lg rounded-lg p-8 w-full max-w-md space-y-6" onSubmit={handleLogin}> <form
className="bg-white shadow-lg rounded-lg p-8 w-full max-w-md space-y-6"
onSubmit={(e) => {
if (initializing) {
e.preventDefault();
return;
}
handleLogin(e);
}}
>
<div> <div>
<h1 className="text-2xl font-bold mb-2 text-center text-gray-800">Pickup Config Login</h1> <h1 className="text-2xl font-bold mb-2 text-center text-gray-800">Pickup Config Login</h1>
<p className="text-sm text-gray-500 text-center"> <p className="text-sm text-gray-500 text-center">
@@ -884,10 +891,10 @@ function App() {
</div> </div>
<button <button
type="submit" type="submit"
disabled={loading} disabled={loading || initializing}
className="w-full bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60" className="w-full bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60"
> >
{loading ? 'Anmeldung läuft...' : 'Anmelden'} {loading || initializing ? 'Anmeldung läuft...' : 'Anmelden'}
</button> </button>
</form> </form>
</div> </div>