fix(chat): handle guest total limit
This commit is contained in:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user