diff --git a/src/renderer/src/components/status-bar/StatusBar.tsx b/src/renderer/src/components/status-bar/StatusBar.tsx index b9a236458ca..52f743aaab6 100644 --- a/src/renderer/src/components/status-bar/StatusBar.tsx +++ b/src/renderer/src/components/status-bar/StatusBar.tsx @@ -160,14 +160,12 @@ function ClaudeSwitcherMenu({ // Why: inactive-account usage is needed only for the explicit switcher // expansion, so fetch it on that event instead of one render later. const handleAccountsExpandedToggle = useCallback((): void => { - setAccountsExpanded((current) => { - const nextExpanded = !current - if (nextExpanded) { - void fetchInactiveClaudeAccountUsage() - } - return nextExpanded - }) - }, [fetchInactiveClaudeAccountUsage]) + const nextExpanded = !accountsExpanded + setAccountsExpanded(nextExpanded) + if (nextExpanded) { + void fetchInactiveClaudeAccountUsage() + } + }, [accountsExpanded, fetchInactiveClaudeAccountUsage]) const handleSelectAccount = async (accountId: string | null): Promise => { if (isSwitching) {