debug(chat): adiciona logs no clique da lista de sessoes
Logs para debugar problema de clique não funcionando na lista de sessões do desktop. 🤖 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
973e3496e2
commit
ca59b6ed92
2 changed files with 10 additions and 2 deletions
|
|
@ -100,10 +100,13 @@ export function ChatHubWidget() {
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const handleSelectSession = async (ticketId: string, ticketRef: number) => {
|
const handleSelectSession = async (ticketId: string, ticketRef: number) => {
|
||||||
|
console.log("[ChatHub] Selecionando sessao:", { ticketId, ticketRef })
|
||||||
try {
|
try {
|
||||||
await invoke("open_chat_window", { ticketId, ticketRef })
|
await invoke("open_chat_window", { ticketId, ticketRef })
|
||||||
|
console.log("[ChatHub] Janela aberta com sucesso")
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Erro ao abrir janela de chat:", err)
|
console.error("[ChatHub] Erro ao abrir janela de chat:", err)
|
||||||
|
alert(`Erro ao abrir chat: ${err}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,15 @@ function formatTime(timestamp: number) {
|
||||||
export function ChatSessionItem({ session, isActive, onClick }: ChatSessionItemProps) {
|
export function ChatSessionItem({ session, isActive, onClick }: ChatSessionItemProps) {
|
||||||
const hasUnread = session.unreadCount > 0
|
const hasUnread = session.unreadCount > 0
|
||||||
|
|
||||||
|
const handleClick = () => {
|
||||||
|
console.log("[ChatSessionItem] Clicado:", session.ticketId, session.ticketRef)
|
||||||
|
onClick()
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={onClick}
|
onClick={handleClick}
|
||||||
className={`flex w-full items-start gap-3 border-b border-slate-100 px-4 py-3 text-left transition-colors hover:bg-slate-50 ${
|
className={`flex w-full items-start gap-3 border-b border-slate-100 px-4 py-3 text-left transition-colors hover:bg-slate-50 ${
|
||||||
isActive ? "bg-slate-100" : ""
|
isActive ? "bg-slate-100" : ""
|
||||||
} ${hasUnread ? "bg-red-50/50 hover:bg-red-50" : ""}`}
|
} ${hasUnread ? "bg-red-50/50 hover:bg-red-50" : ""}`}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue