fix: corrige chat reabrindo sozinho e melhora mensagens
- Remove window.show() que forçava chat reabrir a cada polling - Chat só abre minimizado quando há NOVAS mensagens (janela não existia) - Se usuário fechou o chat, não reabre automaticamente - Corrige acentuação: "Voce" → "Você", "nao" → "não" - Simplifica toast para "Chat ao vivo iniciado" - Melhora mensagem de erro quando máquina está offline - Loga erro técnico no console ao invés de exibir para usuário 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e66b3cce92
commit
0afdba1635
6 changed files with 33 additions and 16 deletions
|
|
@ -302,7 +302,7 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) {
|
|||
setMessages(prev => [...prev, {
|
||||
id: response.messageId,
|
||||
body: messageText || (attachmentsToSend.length > 0 ? "[Anexo]" : ""),
|
||||
authorName: "Voce",
|
||||
authorName: "Você",
|
||||
isFromMachine: true,
|
||||
createdAt: response.createdAt,
|
||||
attachments: attachmentsToSend.map(a => ({
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export function ChatApp() {
|
|||
if (!ticketId) {
|
||||
return (
|
||||
<div className="flex h-screen flex-col items-center justify-center bg-white p-4">
|
||||
<p className="text-sm text-red-600">Erro: ticketId nao fornecido</p>
|
||||
<p className="text-sm text-red-600">Erro: ticketId não fornecido</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ export function ChatFloatingWidget({
|
|||
setMessages(prev => [...prev, {
|
||||
id: response.messageId,
|
||||
body: messageText,
|
||||
authorName: "Voce",
|
||||
authorName: "Você",
|
||||
isFromMachine: true,
|
||||
createdAt: response.createdAt,
|
||||
attachments: [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue