fixed chat textjson format, selected session for all, fixed android echo

This commit is contained in:
2026-03-29 03:18:02 +02:00
parent f2aebcbad9
commit 1972c4d1b4
3 changed files with 50 additions and 12 deletions
+17 -8
View File
@@ -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