fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { ChatMessage } from '@/lib/api';
|
||||
import { isVideoNoteFileName } from '@/lib/chat-media';
|
||||
import { emojiIdToNative, resolveNativeEmojiContent } from '@/lib/emoji-native-map';
|
||||
|
||||
export const QUICK_REACTIONS = ['👍', '❤️', '😂', '😮', '😢', '🙏', '🔥', '👏'] as const;
|
||||
@@ -58,6 +59,16 @@ export function getMessagePreviewText(message: ChatMessage, visibleText?: string
|
||||
if (message.type === 'IMAGE') return '📷 Фото';
|
||||
if (message.type === 'VIDEO') return '🎬 Видео';
|
||||
if (message.type === 'VIDEO_NOTE') return '⭕ Кружок';
|
||||
if (message.type === 'VIDEO' || message.type === 'FILE') {
|
||||
const meta = message.metadataJson ? (() => {
|
||||
try {
|
||||
return JSON.parse(message.metadataJson) as { fileName?: string; videoNote?: boolean };
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
})() : {};
|
||||
if (meta.videoNote || isVideoNoteFileName(meta.fileName || message.content)) return '⭕ Кружок';
|
||||
}
|
||||
if (message.type === 'LOCATION') return '📍 Геопозиция';
|
||||
if (message.type === 'VOICE') return '🎤 Голосовое';
|
||||
if (message.type === 'AUDIO') return '🎵 Аудио';
|
||||
|
||||
Reference in New Issue
Block a user