Skip to content

Commit a81ecad

Browse files
authored
fix: handle null quota display in ZgsmAccountView (#485)
1 parent c34daa6 commit a81ecad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

webview-ui/src/components/cloud/ZgsmAccountView.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ const QuotaInfoDisplay = memo(
123123
usagePercentage,
124124
progressWidth,
125125
isStarred,
126-
totalQuotaDisplay: quotaInfo.total_quota ? quotaInfo.total_quota.toLocaleString() : "-",
127-
usedQuotaDisplay: quotaInfo.used_quota ? quotaInfo.used_quota.toLocaleString() : "-",
126+
totalQuotaDisplay: quotaInfo.total_quota ? quotaInfo.total_quota.toLocaleString() : "",
127+
usedQuotaDisplay: quotaInfo.used_quota ? quotaInfo.used_quota.toLocaleString() : "",
128128
}
129129
}, [quotaInfo.total_quota, quotaInfo.used_quota, quotaInfo.is_star])
130130

@@ -362,7 +362,9 @@ const ZgsmAccountViewComponent = ({ apiConfiguration, onDone }: AccountViewProps
362362
<p className="text-xs text-vscode-descriptionForeground mb-1">{userInfo?.email}</p>
363363
)}
364364
{/* 星标状态卡片 */}
365-
<StarStatusCard quotaInfo={quotaInfo} onStarRepository={handleStarRepository} _t={t} />
365+
{quotaInfo?.is_star != null && (
366+
<StarStatusCard quotaInfo={quotaInfo} onStarRepository={handleStarRepository} _t={t} />
367+
)}
366368
{/* 配额信息显示区域 */}
367369
{isLoadingQuota && !quotaInfo && <QuotaSkeleton />}
368370
{quotaInfo && (

0 commit comments

Comments
 (0)