From e34513cbc405635825cf18c6aebef7b82ed13bf4 Mon Sep 17 00:00:00 2001 From: CodingOnStar Date: Sun, 4 Jan 2026 12:03:02 +0800 Subject: [PATCH] fix: correct translation errors in Japanese and Chinese JSON files, and improve type safety in quota panel component --- .../provider-added-card/quota-panel.tsx | 7 ++++--- web/i18n/ja-JP/common.json | 2 +- web/i18n/zh-Hans/billing.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) 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 abb129c600..e296bc4555 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 @@ -1,5 +1,6 @@ import type { FC } from 'react' import type { ModelProvider } from '../declarations' +import type { Plugin } from '@/app/components/plugins/types' import { useBoolean } from 'ahooks' import * as React from 'react' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' @@ -46,7 +47,7 @@ const QuotaPanel: FC = ({ }) => { const { t } = useTranslation() const { currentWorkspace } = useAppContext() - const credits = Math.max(currentWorkspace.trial_credits - currentWorkspace.trial_credits_used || 0, 0) + const credits = Math.max((currentWorkspace.trial_credits - currentWorkspace.trial_credits_used) || 0, 0) const providerMap = useMemo(() => new Map( providers.map(p => [p.provider, p.preferred_provider_type]), ), [providers]) @@ -54,7 +55,7 @@ const QuotaPanel: FC = ({ const { plugins: allPlugins, } = useMarketplaceAllPlugins(providers, '') - const [selectedPlugin, setSelectedPlugin] = useState(null) + const [selectedPlugin, setSelectedPlugin] = useState(null) const [isShowInstallModal, { setTrue: showInstallFromMarketplace, setFalse: hideInstallFromMarketplace, @@ -147,7 +148,7 @@ const QuotaPanel: FC = ({ })} - {isShowInstallModal && ( + {isShowInstallModal && selectedPlugin && (