refactor(chat): remove private unlock machine flow

This commit is contained in:
2026-06-26 19:17:29 +08:00
parent b6f18a1ef3
commit 1b73c3ac10
11 changed files with 27 additions and 302 deletions
+4 -12
View File
@@ -5,7 +5,6 @@ import { TextBubble } from "./text-bubble";
import { VoiceBubble } from "./voice-bubble";
export interface MessageContentProps {
messageId?: string;
content: string;
imageUrl?: string | null;
imagePaywalled?: boolean;
@@ -15,8 +14,7 @@ export interface MessageContentProps {
lockReason?: string | null;
lockedPrivate?: boolean | null;
privateMessageHint?: string | null;
isUnlockingPrivate?: boolean;
onUnlockPrivateMessage?: (messageId: string) => void;
onUnlockPrivateMessage?: () => void;
onUnlockImagePaywall?: () => void;
onUnlockVoiceMessage?: () => void;
}
@@ -24,7 +22,6 @@ export interface MessageContentProps {
const IMAGE_PLACEHOLDER = "[图片]";
export function MessageContent({
messageId,
content,
imageUrl,
imagePaywalled,
@@ -34,7 +31,6 @@ export function MessageContent({
lockReason,
lockedPrivate,
privateMessageHint,
isUnlockingPrivate = false,
onUnlockPrivateMessage,
onUnlockImagePaywall,
onUnlockVoiceMessage,
@@ -63,12 +59,8 @@ export function MessageContent({
{isLockedPrivateMessage ? (
<PrivateMessageCard
hint={privateMessageHint}
isUnlocking={isUnlockingPrivate}
onUnlock={
messageId
? () => onUnlockPrivateMessage?.(messageId)
: undefined
}
isUnlocking={false}
onUnlock={onUnlockPrivateMessage}
/>
) : (
<>
@@ -85,7 +77,7 @@ export function MessageContent({
isFromAI={isFromAI}
locked={isLockedVoiceMessage}
hint={privateMessageHint}
isUnlocking={isUnlockingPrivate}
isUnlocking={false}
onUnlock={
isLockedVoiceMessage
? onUnlockVoiceMessage