fix(chat): preserve private send response fields
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
/**
|
||||
* ChatArea 消息列表区
|
||||
*
|
||||
* 原始 Dart: lib/ui/chat/widgets/chat_area.dart(153 行)
|
||||
*
|
||||
* 组成(自上而下):
|
||||
* - AI 披露横幅
|
||||
* - 日期分隔条
|
||||
|
||||
@@ -26,6 +26,9 @@ export class ChatSendResponse {
|
||||
declare readonly paywallTriggered: boolean;
|
||||
declare readonly showUpgrade: boolean;
|
||||
declare readonly imageType: string | null;
|
||||
declare readonly isPrivate: boolean | null;
|
||||
declare readonly privateLocked: boolean | null;
|
||||
declare readonly privateHint: string | null;
|
||||
declare readonly imageUrl: string | null;
|
||||
|
||||
private constructor(input: ChatSendResponseInput) {
|
||||
|
||||
@@ -30,6 +30,9 @@ export const ChatSendResponseSchema = z.object({
|
||||
paywallTriggered: z.boolean().default(false),
|
||||
showUpgrade: z.boolean().default(false),
|
||||
imageType: z.string().nullable().default(null),
|
||||
isPrivate: z.boolean().nullable().default(null),
|
||||
privateLocked: z.boolean().nullable().default(null),
|
||||
privateHint: z.string().nullable().default(null),
|
||||
imageUrl: z.string().nullable().default(null),
|
||||
});
|
||||
|
||||
|
||||
@@ -41,8 +41,6 @@ export function getActiveChatWebSocket(): ChatWebSocket | null {
|
||||
return activeChatWebSocket;
|
||||
}
|
||||
|
||||
// 本地游客消息额度 actor 已停用:消息数量限制统一交由后端 blocked/daily_limit 响应处理。
|
||||
|
||||
// ============================================================
|
||||
// Init 任务 2:拉 history 3 步流(fromPromise,返回最终结果)
|
||||
// ============================================================
|
||||
|
||||
@@ -89,6 +89,13 @@ export function sendResponseToUiMessage(response: ChatSendResponse): UiMessage {
|
||||
...(response.showUpgrade && response.imageUrl
|
||||
? { imagePaywalled: true }
|
||||
: {}),
|
||||
...(response.isPrivate != null ? { isPrivate: response.isPrivate } : {}),
|
||||
...(response.privateLocked != null
|
||||
? { privateLocked: response.privateLocked }
|
||||
: {}),
|
||||
...(response.privateHint != null
|
||||
? { privateHint: response.privateHint }
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user