fix(chat): handle guest total limit

This commit is contained in:
2026-06-23 15:14:17 +08:00
parent c4a33576bb
commit f14b8a48d2
5 changed files with 74 additions and 10 deletions
+10 -4
View File
@@ -43,10 +43,15 @@ export function ChatScreen() {
// isGuest 派生(chat-screen 是唯一知道这个值的地方 —— chat 机器无 isGuest 字段)
const isGuest = deriveIsGuest(authState.loginStatus);
// 消息数量限制由后端统一返回 blocked/daily_limit,前端不再处理本地额度。
const showDailyLimitBanner =
// 消息数量限制由后端统一返回 blocked,前端不再处理本地额度。
const showMessageLimitBanner =
state.paywallTriggered &&
state.paywallReason === "daily_limit";
(state.paywallReason === "daily_limit" ||
state.paywallReason === "total_limit");
const messageLimitTitle =
state.paywallReason === "total_limit"
? "The limit for free chat times\nhas been reached"
: undefined;
const showPhotoPaywallBanner =
state.paywallTriggered && state.paywallReason === "photo_paywall";
const showPrivatePaywallBanner =
@@ -168,8 +173,9 @@ export function ChatScreen() {
/>
) : null}
{showDailyLimitBanner ? (
{showMessageLimitBanner ? (
<ChatQuotaExhaustedBanner
title={messageLimitTitle}
/>
) : (
<ChatInputBar disabled={state.isReplyingAI} />