From 8d45aeb2364292c064d4a41b08bbd4a77524d05c Mon Sep 17 00:00:00 2001 From: arafatkatze Date: Wed, 9 Jul 2025 18:32:29 -0600 Subject: [PATCH] Fix Flaky Cline provider toggle --- .changeset/little-bugs-pull.md | 5 +++++ webview-ui/src/components/account/AccountView.tsx | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/little-bugs-pull.md diff --git a/.changeset/little-bugs-pull.md b/.changeset/little-bugs-pull.md new file mode 100644 index 0000000000..8e97f35d19 --- /dev/null +++ b/.changeset/little-bugs-pull.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +Fix flaky cline provider toggle diff --git a/webview-ui/src/components/account/AccountView.tsx b/webview-ui/src/components/account/AccountView.tsx index 8ed4da17b0..eff2fe3710 100644 --- a/webview-ui/src/components/account/AccountView.tsx +++ b/webview-ui/src/components/account/AccountView.tsx @@ -48,6 +48,7 @@ export const ClineAccountView = () => { const [userOrganizations, setUserOrganizations] = useState([]) const [activeOrganization, setActiveOrganization] = useState(null) const [isLoading, setIsLoading] = useState(true) + const [isSwitchingOrg, setIsSwitchingOrg] = useState(false) const [usageData, setUsageData] = useState([]) const [paymentsData, setPaymentsData] = useState([]) @@ -96,6 +97,11 @@ export const ClineAccountView = () => { Promise.all([getUserCredits(), getUserOrganizations()]) } catch (error) { console.error("Failed to fetch user data:", error) + setBalance(0) + setUsageData([]) + setPaymentsData([]) + } finally { + setIsLoading(false) } } @@ -155,9 +161,10 @@ export const ClineAccountView = () => { {userOrganizations && ( Personal {userOrganizations.map((org: UserOrganization) => (