diff --git a/web/src/lib/auth.svelte.ts b/web/src/lib/auth.svelte.ts index b94661259..2b6cda536 100644 --- a/web/src/lib/auth.svelte.ts +++ b/web/src/lib/auth.svelte.ts @@ -93,6 +93,7 @@ export interface Auth { readonly profile: AuthProfile | null; readonly error: string | null; readonly resolving: boolean; + readonly agentPending: boolean; readonly currentUser: CurrentUser | null; readonly accounts: AuthAccount[]; hasAccount(did: string): boolean; @@ -517,6 +518,13 @@ export const createAuth = ( (state.kind === "loading" && state.did === null) ); }, + get agentPending() { + return ( + state.kind === "authenticating" || + state.kind === "loading" || + (state.kind === "profile-loading" && state.profile === null) + ); + }, get currentUser() { const did = currentDid(); if (!did) return null; diff --git a/web/src/lib/components/timeline/timelineFeed.svelte.ts b/web/src/lib/components/timeline/timelineFeed.svelte.ts index aefd09317..9d9c57857 100644 --- a/web/src/lib/components/timeline/timelineFeed.svelte.ts +++ b/web/src/lib/components/timeline/timelineFeed.svelte.ts @@ -23,7 +23,7 @@ export const createTimelineFeed = (opts: TimelineFeedOptions) => { $effect(() => { const isEnabled = opts.enabled ? opts.enabled() : true; - if (!isEnabled || auth.resolving) return; + if (!isEnabled || auth.agentPending) return; const agent = auth.agent ?? undefined; const wantFollowing = opts.followingOnly() && Boolean(auth.currentDid); @@ -53,7 +53,7 @@ export const createTimelineFeed = (opts: TimelineFeedOptions) => { $effect(() => { const isEnabled = opts.enabled ? opts.enabled() : true; - if (!isEnabled || auth.resolving) return; + if (!isEnabled || auth.agentPending) return; const agent = auth.agent ?? undefined;