fix(org-site): stabilize landing-page nav auth button

The auth button derived from stores that hydrate in stages, so it
flashed through Login -> Dashboard -> Go to LMS as isLoggedIn and the
role/basePath settled at different times. Gate the label on
appInitApi.isInitializedAndReady so it only renders once the account
(and thus role) has loaded, and show a spinner in the button while a
logged-in user's experience resolves. Add separate loading and disabled
flags to authAction and wire them through all theme navs.
This commit is contained in:
Rotimi Best
2026-06-14 10:10:14 +01:00
parent a411c50526
commit 0c395e9f1b
12 changed files with 86 additions and 16 deletions
@@ -10,6 +10,8 @@
authAction?: {
label: string;
href: string;
loading?: boolean;
disabled?: boolean;
};
}
@@ -41,7 +43,13 @@
{/each}
</nav>
{#if authAction}
<Button href={authAction.href} variant="outline" class="ui:rounded-xl ui:font-bold">
<Button
href={authAction.href}
loading={authAction.loading}
disabled={authAction.disabled}
variant="outline"
class="ui:rounded-xl ui:font-bold"
>
{authAction.label}
</Button>
{/if}