From 55aa4e424ac5efc7fcca462dd9719b562c37af61 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 20 Feb 2025 14:04:13 +0800 Subject: [PATCH] fix: quota less than zero show error (#14080) --- .../model-provider-page/provider-added-card/quota-panel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx index 8d0ea83d6..b7772ef69 100644 --- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx +++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx @@ -41,7 +41,7 @@ const QuotaPanel: FC = ({ { currentQuota && (
- {formatNumber((currentQuota?.quota_limit || 0) - (currentQuota?.quota_used || 0))} + {formatNumber(Math.max((currentQuota?.quota_limit || 0) - (currentQuota?.quota_used || 0), 0))} { currentQuota?.quota_unit === QuotaUnitEnum.tokens && 'Tokens' }