From 8440246eb2bb1c737d58edcb2dd47b64edb4e978 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Thu, 10 Sep 2026 23:11:00 -0400 Subject: [PATCH] fix: retry transient auth readiness failures --- .../src/components/UnexpectedSignoutCard.tsx | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/components/UnexpectedSignoutCard.tsx b/src/renderer/src/components/UnexpectedSignoutCard.tsx index 491adce4221..ee0e8949ec3 100644 --- a/src/renderer/src/components/UnexpectedSignoutCard.tsx +++ b/src/renderer/src/components/UnexpectedSignoutCard.tsx @@ -59,14 +59,24 @@ export function UnexpectedSignoutCard(): React.JSX.Element | null { useEffect(() => { let cancelled = false - void useAppStore - .getState() - .fetchOrcaProfileAuthStatus() - .then((status) => { - if (!cancelled && status != null) { - setAuthRefreshReady(true) - } - }) + let attempts = 0 + const refresh = (): void => { + attempts += 1 + void useAppStore + .getState() + .fetchOrcaProfileAuthStatus() + .then((status) => { + if (cancelled) { + return + } + if (status != null) { + setAuthRefreshReady(true) + } else if (attempts < 3) { + window.setTimeout(refresh, 500) + } + }) + } + refresh() return () => { cancelled = true }