fixed chat textjson format, selected session for all, fixed android echo
This commit is contained in:
@@ -96,14 +96,23 @@ const ChatScreen: React.FC = () => {
|
||||
const sender = (message.payload.sender as string) || '';
|
||||
if (sender === 'user' || sender === 'diagnostic') return;
|
||||
|
||||
const ariaMsg: ChatMessage = {
|
||||
id: nextId(),
|
||||
sender: 'aria',
|
||||
text: (message.payload.text as string) || '',
|
||||
timestamp: message.timestamp,
|
||||
attachments: message.payload.attachments as Attachment[] | undefined,
|
||||
};
|
||||
setMessages(prev => [...prev, ariaMsg]);
|
||||
const text = (message.payload.text as string) || '';
|
||||
const ts = message.timestamp;
|
||||
// Duplikat-Schutz: gleicher Text innerhalb 5s ignorieren
|
||||
setMessages(prev => {
|
||||
const isDuplicate = prev.some(m =>
|
||||
m.sender === 'aria' && m.text === text && Math.abs(m.timestamp - ts) < 5000
|
||||
);
|
||||
if (isDuplicate) return prev;
|
||||
const ariaMsg: ChatMessage = {
|
||||
id: nextId(),
|
||||
sender: 'aria',
|
||||
text,
|
||||
timestamp: ts,
|
||||
attachments: message.payload.attachments as Attachment[] | undefined,
|
||||
};
|
||||
return [...prev, ariaMsg];
|
||||
});
|
||||
}
|
||||
|
||||
// TTS-Audio abspielen wenn vorhanden
|
||||
|
||||
Reference in New Issue
Block a user