refactor: disable login if we are not inited or are logged in
This commit is contained in:
parent
e913aa9075
commit
493d27c402
|
@ -6,15 +6,18 @@ import {
|
||||||
} from "@lumeweb/sdk";
|
} from "@lumeweb/sdk";
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const { isLoggedIn, ready } = useLume();
|
const { isLoggedIn, ready, inited } = useLume();
|
||||||
|
|
||||||
|
let loginDisabled = !inited || isLoggedIn;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LumeIdentity>
|
<LumeIdentity>
|
||||||
<LumeIdentityTrigger asChild disabled={!ready}>
|
<LumeIdentityTrigger asChild disabled={loginDisabled}>
|
||||||
{
|
{
|
||||||
<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={!ready}
|
disabled={loginDisabled}
|
||||||
>
|
>
|
||||||
Login
|
Login
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in New Issue