fix: keep login screen visible until store refresh completes
This commit is contained in:
21
src/App.js
21
src/App.js
@@ -494,13 +494,11 @@ function App() {
|
||||
});
|
||||
}
|
||||
}
|
||||
finishSyncProgress();
|
||||
} catch (err) {
|
||||
console.warn('Konnte Session nicht wiederherstellen:', err);
|
||||
} finally {
|
||||
if (ticker) {
|
||||
clearInterval(ticker);
|
||||
}
|
||||
finishSyncProgress();
|
||||
} finally {
|
||||
setInitializing(false);
|
||||
}
|
||||
})();
|
||||
@@ -842,7 +840,16 @@ function App() {
|
||||
return (
|
||||
<>
|
||||
<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>
|
||||
<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">
|
||||
@@ -884,10 +891,10 @@ function App() {
|
||||
</div>
|
||||
<button
|
||||
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"
|
||||
>
|
||||
{loading ? 'Anmeldung läuft...' : 'Anmelden'}
|
||||
{loading || initializing ? 'Anmeldung läuft...' : 'Anmelden'}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user