fix: revert and only render LumeIdentity when not logged in, and disable it when not inited
This commit is contained in:
parent
493d27c402
commit
45632397f0
|
@ -8,22 +8,22 @@ import {
|
||||||
export default function () {
|
export default function () {
|
||||||
const { isLoggedIn, ready, inited } = useLume();
|
const { isLoggedIn, ready, inited } = useLume();
|
||||||
|
|
||||||
let loginDisabled = !inited || isLoggedIn;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LumeIdentity>
|
{!isLoggedIn && (
|
||||||
<LumeIdentityTrigger asChild disabled={loginDisabled}>
|
<LumeIdentity>
|
||||||
{
|
<LumeIdentityTrigger asChild disabled={!inited}>
|
||||||
<button
|
{
|
||||||
className="ml-2 w-full rounded-full bg-[hsl(113,49%,55%)] text-black disabled:pointer-events-none disabled:opacity-50"
|
<button
|
||||||
disabled={loginDisabled}
|
className="ml-2 w-full rounded-full bg-[hsl(113,49%,55%)] text-black disabled:pointer-events-none disabled:opacity-50"
|
||||||
>
|
disabled={!inited}
|
||||||
Login
|
>
|
||||||
</button>
|
Login
|
||||||
}
|
</button>
|
||||||
</LumeIdentityTrigger>
|
}
|
||||||
</LumeIdentity>
|
</LumeIdentityTrigger>
|
||||||
|
</LumeIdentity>
|
||||||
|
)}
|
||||||
{isLoggedIn && ready && <LumeDashboard />}
|
{isLoggedIn && ready && <LumeDashboard />}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue