Fix Login loading state check to prevent infinite loading
cgen-25a68a3457824b3394a0d914af3b0f4e
This commit is contained in:
parent
9a99b23ca7
commit
03ca1fa22f
1 changed files with 13 additions and 1 deletions
|
|
@ -83,7 +83,8 @@ export default function Login() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isLoading) {
|
// Show loading screen only during form submission, not during auth context loading
|
||||||
|
if (isLoading && !loading) {
|
||||||
return (
|
return (
|
||||||
<LoadingScreen
|
<LoadingScreen
|
||||||
message="Authenticating your account..."
|
message="Authenticating your account..."
|
||||||
|
|
@ -93,6 +94,17 @@ export default function Login() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If auth context is still loading, show a different loading state
|
||||||
|
if (loading) {
|
||||||
|
return (
|
||||||
|
<LoadingScreen
|
||||||
|
message="Initializing AeThex OS..."
|
||||||
|
showProgress={true}
|
||||||
|
duration={3000}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<div className="min-h-screen bg-aethex-gradient py-12 flex items-center justify-center">
|
<div className="min-h-screen bg-aethex-gradient py-12 flex items-center justify-center">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue