mirror of
https://github.com/cline/cline.git
synced 2026-09-19 02:05:44 +08:00
Fix Flaky Cline provider toggle
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Fix flaky cline provider toggle
|
||||
@@ -48,6 +48,7 @@ export const ClineAccountView = () => {
|
||||
const [userOrganizations, setUserOrganizations] = useState<UserOrganization[]>([])
|
||||
const [activeOrganization, setActiveOrganization] = useState<UserOrganization | null>(null)
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
const [isSwitchingOrg, setIsSwitchingOrg] = useState(false)
|
||||
const [usageData, setUsageData] = useState<UsageTransaction[]>([])
|
||||
const [paymentsData, setPaymentsData] = useState<PaymentTransaction[]>([])
|
||||
|
||||
@@ -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 && (
|
||||
<VSCodeDropdown
|
||||
key={`dropdown-${activeOrganization?.organizationId || "Personal"}`}
|
||||
key={activeOrganization?.organizationId || "personal"}
|
||||
currentValue={activeOrganization?.organizationId || ""}
|
||||
onChange={handleOrganizationChange}
|
||||
disabled={isSwitchingOrg || isLoading}
|
||||
style={{ width: "100%", marginTop: "4px" }}>
|
||||
<VSCodeOption value="">Personal</VSCodeOption>
|
||||
{userOrganizations.map((org: UserOrganization) => (
|
||||
|
||||
Reference in New Issue
Block a user