fix: corrige cliques nao responsivos e erros silenciosos
- Remove coluna de acoes sem implementacao em data-table - Corrige loading states travados em new-ticket-dialog, close-ticket-dialog - Adiciona finally blocks em forgot-password e reset-password - Adiciona tratamento de erros em invokes do Tauri (ChatWidget, ChatHubWidget) 🤖 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
a285e6f252
commit
7a3791117b
7 changed files with 51 additions and 63 deletions
|
|
@ -61,22 +61,30 @@ export function ChatHubWidget() {
|
|||
// Quando nova sessao inicia
|
||||
listen<SessionStartedEvent>("raven://chat/session-started", () => {
|
||||
loadSessions()
|
||||
}).then((unlisten) => unlisteners.push(unlisten))
|
||||
}).then((unlisten) => unlisteners.push(unlisten)).catch((err) => {
|
||||
console.error("Erro ao registrar listener session-started:", err)
|
||||
})
|
||||
|
||||
// Quando sessao encerra
|
||||
listen<SessionEndedEvent>("raven://chat/session-ended", () => {
|
||||
loadSessions()
|
||||
}).then((unlisten) => unlisteners.push(unlisten))
|
||||
}).then((unlisten) => unlisteners.push(unlisten)).catch((err) => {
|
||||
console.error("Erro ao registrar listener session-ended:", err)
|
||||
})
|
||||
|
||||
// Quando contador de nao lidos muda
|
||||
listen<UnreadUpdateEvent>("raven://chat/unread-update", (event) => {
|
||||
setSessions(event.payload.sessions || [])
|
||||
}).then((unlisten) => unlisteners.push(unlisten))
|
||||
}).then((unlisten) => unlisteners.push(unlisten)).catch((err) => {
|
||||
console.error("Erro ao registrar listener unread-update:", err)
|
||||
})
|
||||
|
||||
// Quando nova mensagem chega
|
||||
listen<NewMessageEvent>("raven://chat/new-message", (event) => {
|
||||
setSessions(event.payload.sessions || [])
|
||||
}).then((unlisten) => unlisteners.push(unlisten))
|
||||
}).then((unlisten) => unlisteners.push(unlisten)).catch((err) => {
|
||||
console.error("Erro ao registrar listener new-message:", err)
|
||||
})
|
||||
|
||||
return () => {
|
||||
unlisteners.forEach((unlisten) => unlisten())
|
||||
|
|
@ -129,7 +137,9 @@ export function ChatHubWidget() {
|
|||
}
|
||||
|
||||
const handleClose = () => {
|
||||
invoke("close_hub_window")
|
||||
invoke("close_hub_window").catch((err) => {
|
||||
console.error("Erro ao fechar janela do hub:", err)
|
||||
})
|
||||
}
|
||||
|
||||
const totalUnread = sessions.reduce((sum, s) => sum + s.unreadCount, 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue