From fa76bd02d09df70814dbff5b426360ce34c9a14e Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 30 May 2026 04:48:53 -0700 Subject: [PATCH] fix: guard feature wall usage refresh (#3645) --- .../feature-wall/use-feature-wall-completion.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/feature-wall/use-feature-wall-completion.ts b/src/renderer/src/components/feature-wall/use-feature-wall-completion.ts index 6e9066bf2..fe348a3e5 100644 --- a/src/renderer/src/components/feature-wall/use-feature-wall-completion.ts +++ b/src/renderer/src/components/feature-wall/use-feature-wall-completion.ts @@ -19,6 +19,7 @@ import { import { hasFeatureWallUsageTracking } from './feature-wall-usage-tracking' import { usePersistedFeatureWallCompletion } from './use-persisted-feature-wall-completion' import { useFeatureWallSessionDepth } from './use-feature-wall-session-depth' +import { useMountedRef } from '@/hooks/useMountedRef' export type FeatureWallCompletionState = { workflowDone: Record @@ -43,6 +44,7 @@ export function useFeatureWallCompletion( ): FeatureWallCompletionState { const { onTourDepthSummaryChange } = options const settings = useAppStore((s) => s.settings) + const mountedRef = useMountedRef() const preflightStatus = useAppStore((s) => s.preflightStatus) const rateLimits = useAppStore((s) => s.rateLimits) const fetchRateLimits = useAppStore((s) => s.fetchRateLimits) @@ -100,8 +102,11 @@ export function useFeatureWallCompletion( }, [rateLimits.claude, rateLimits.codex]) const refreshUsageAccountState = useCallback(async (): Promise => { - setHasUsageAccount(await readUsageAccountState()) - }, [readUsageAccountState]) + const nextHasUsageAccount = await readUsageAccountState() + if (mountedRef.current) { + setHasUsageAccount(nextHasUsageAccount) + } + }, [mountedRef, readUsageAccountState]) const sessionDepth = useFeatureWallSessionDepth({ isOpen,