fix(subscription): 无有效订阅时前端如实显示「仅用订阅」偏好 (#6222) (#7086)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
ruiyunzhao
2026-08-30 20:45:24 +08:00
committed by GitHub
co-authored by Claude
parent dc4732cfed
commit b5b94bc685
8 changed files with 25 additions and 20 deletions
@@ -194,8 +194,6 @@ export function SubscriptionPlansCard({
const isSubPref =
billingPreference === 'subscription_first' ||
billingPreference === 'subscription_only'
const displayPref =
disablePref && isSubPref ? 'wallet_first' : billingPreference
const planPurchaseCountMap = useMemo(() => {
const map = new Map<number, number>()
@@ -332,12 +330,12 @@ export function SubscriptionPlansCard({
label: getBillingPreferenceLabel('wallet_only', t),
},
]}
value={displayPref}
value={billingPreference}
onValueChange={(v) => v !== null && handlePreferenceChange(v)}
>
<SelectTrigger className='h-8 flex-1 text-xs sm:w-[140px] sm:flex-none'>
<SelectValue>
{getBillingPreferenceLabel(displayPref, t)}
{getBillingPreferenceLabel(billingPreference, t)}
</SelectValue>
</SelectTrigger>
<SelectContent alignItemWithTrigger={false}>
@@ -381,15 +379,15 @@ export function SubscriptionPlansCard({
{disablePref && isSubPref && (
<p className='text-muted-foreground mt-2 text-xs'>
{t(
'Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.',
{
pref:
billingPreference === 'subscription_only'
? t('Subscription Only')
: t('Subscription First'),
}
)}
{billingPreference === 'subscription_only'
? t(
'Preference saved as {{pref}}, but no active subscription. Requests will be rejected.',
{ pref: t('Subscription Only') }
)
: t(
'Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.',
{ pref: t('Subscription First') }
)}
</p>
)}
+2 -1
View File
@@ -3640,6 +3640,7 @@
"Pre-consumed": "Pre-consumed",
"Pre-Consumed Quota": "Pre-Consumed Quota",
"Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.": "Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.",
"Preference saved as {{pref}}, but no active subscription. Requests will be rejected.": "Preference saved as {{pref}}, but no active subscription. Requests will be rejected.",
"Preferences": "Preferences",
"Prefill Group Management": "Prefill Group Management",
"Prefill Groups": "Prefill Groups",
@@ -5538,4 +5539,4 @@
"Zhipu V4": "Zhipu V4",
"Zoom": "Zoom"
}
}
}
+2 -1
View File
@@ -3640,6 +3640,7 @@
"Pre-consumed": "Pré-consommé",
"Pre-Consumed Quota": "Quota pré-consommé",
"Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.": "Préférence enregistrée comme {{pref}}, mais aucun abonnement actif. Le portefeuille sera utilisé automatiquement.",
"Preference saved as {{pref}}, but no active subscription. Requests will be rejected.": "Préférence enregistrée comme {{pref}}, mais aucun abonnement actif. Les demandes seront rejetées.",
"Preferences": "Préférences",
"Prefill Group Management": "Gestion des groupes de préremplissage",
"Prefill Groups": "Groupes de préremplissage",
@@ -5538,4 +5539,4 @@
"Zhipu V4": "Zhipu V4",
"Zoom": "Zoom"
}
}
}
+2 -1
View File
@@ -3640,6 +3640,7 @@
"Pre-consumed": "事前消費",
"Pre-Consumed Quota": "事前消費クォータ",
"Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.": "設定は{{pref}}として保存されましたが、アクティブなサブスクリプションがありません。ウォレットが自動的に使用されます。",
"Preference saved as {{pref}}, but no active subscription. Requests will be rejected.": "設定は{{pref}}として保存されましたが、アクティブなサブスクリプションがありません。リクエストは拒否されます。",
"Preferences": "環境設定",
"Prefill Group Management": "プリフィルグループ管理",
"Prefill Groups": "プリフィルグループ",
@@ -5538,4 +5539,4 @@
"Zhipu V4": "Zhipu V 4",
"Zoom": "ズーム"
}
}
}
+2 -1
View File
@@ -3640,6 +3640,7 @@
"Pre-consumed": "Предоплата",
"Pre-Consumed Quota": "Предварительно потребленная квота",
"Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.": "Настройка сохранена как {{pref}}, но нет активной подписки. Кошелёк будет использоваться автоматически.",
"Preference saved as {{pref}}, but no active subscription. Requests will be rejected.": "Настройка сохранена как {{pref}}, но нет активной подписки. Запросы будут отклонены.",
"Preferences": "Настройки",
"Prefill Group Management": "Управление группами автозаполнения",
"Prefill Groups": "Группы автозаполнения",
@@ -5538,4 +5539,4 @@
"Zhipu V4": "Zhipu V4",
"Zoom": "Zoom"
}
}
}
+2 -1
View File
@@ -3640,6 +3640,7 @@
"Pre-consumed": "Khấu trừ trước",
"Pre-Consumed Quota": "Hạn mức đã tiêu thụ trước",
"Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.": "Tùy chọn đã lưu là {{pref}}, nhưng không có gói đăng ký đang hoạt động. Ví sẽ được sử dụng tự động.",
"Preference saved as {{pref}}, but no active subscription. Requests will be rejected.": "Tùy chọn đã lưu là {{pref}}, nhưng không có gói đăng ký đang hoạt động. Các yêu cầu sẽ bị từ chối.",
"Preferences": "Tùy chọn",
"Prefill Group Management": "Quản lý Nhóm Điền sẵn",
"Prefill Groups": "Điền sẵn các nhóm",
@@ -5538,4 +5539,4 @@
"Zhipu V4": "Zhipu V4",
"Zoom": "Zoom"
}
}
}
+2 -1
View File
@@ -3640,6 +3640,7 @@
"Pre-consumed": "預扣費",
"Pre-Consumed Quota": "預消耗配額",
"Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.": "已儲存偏好為{{pref}},目前無生效訂閱,將自動使用錢包",
"Preference saved as {{pref}}, but no active subscription. Requests will be rejected.": "已儲存偏好為{{pref}},目前無生效訂閱,請求將被拒絕",
"Preferences": "偏好設定",
"Prefill Group Management": "預填充分組管理",
"Prefill Groups": "預填充分組",
@@ -5538,4 +5539,4 @@
"Zhipu V4": "智譜 V4",
"Zoom": "縮放"
}
}
}
+2 -1
View File
@@ -3640,6 +3640,7 @@
"Pre-consumed": "预扣费",
"Pre-Consumed Quota": "预消耗配额",
"Preference saved as {{pref}}, but no active subscription. Wallet will be used automatically.": "已保存偏好为{{pref}},当前无生效订阅,将自动使用钱包",
"Preference saved as {{pref}}, but no active subscription. Requests will be rejected.": "已保存偏好为{{pref}},当前无生效订阅,请求将被拒绝",
"Preferences": "偏好设置",
"Prefill Group Management": "预填充分组管理",
"Prefill Groups": "预填充分组",
@@ -5538,4 +5539,4 @@
"Zhipu V4": "智谱 V4",
"Zoom": "缩放"
}
}
}