fix: revert and only render LumeIdentity when not logged in, and disable it when not inited

This commit is contained in:
Derrick Hammer 2023-10-12 13:56:18 -04:00
parent 493d27c402
commit 45632397f0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 14 additions and 14 deletions

View File

@ -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 (
<> <>
{!isLoggedIn && (
<LumeIdentity> <LumeIdentity>
<LumeIdentityTrigger asChild disabled={loginDisabled}> <LumeIdentityTrigger asChild disabled={!inited}>
{ {
<button <button
className="ml-2 w-full rounded-full bg-[hsl(113,49%,55%)] text-black disabled:pointer-events-none disabled:opacity-50" className="ml-2 w-full rounded-full bg-[hsl(113,49%,55%)] text-black disabled:pointer-events-none disabled:opacity-50"
disabled={loginDisabled} disabled={!inited}
> >
Login Login
</button> </button>
} }
</LumeIdentityTrigger> </LumeIdentityTrigger>
</LumeIdentity> </LumeIdentity>
)}
{isLoggedIn && ready && <LumeDashboard />} {isLoggedIn && ready && <LumeDashboard />}
</> </>
); );