Corrige verificacao de machineId para botao de chat
Usa ticket.machine?.id ao inves de ticket.machineId inexistente para determinar se o botao de chat deve aparecer. 🤖 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
c9c08f8e38
commit
0bd9e993d5
1 changed files with 3 additions and 2 deletions
|
|
@ -315,9 +315,10 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
|
||||||
| undefined
|
| undefined
|
||||||
|
|
||||||
// Live Chat
|
// Live Chat
|
||||||
|
const ticketMachineId = ticket.machine?.id ?? null
|
||||||
const liveChatSession = useQuery(
|
const liveChatSession = useQuery(
|
||||||
api.liveChat.getTicketSession,
|
api.liveChat.getTicketSession,
|
||||||
convexUserId && ticket.machineId
|
convexUserId && ticketMachineId
|
||||||
? { ticketId: ticket.id as Id<"tickets">, viewerId: convexUserId as Id<"users"> }
|
? { ticketId: ticket.id as Id<"tickets">, viewerId: convexUserId as Id<"users"> }
|
||||||
: "skip"
|
: "skip"
|
||||||
) as {
|
) as {
|
||||||
|
|
@ -334,7 +335,7 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
|
||||||
const [isStartingChat, setIsStartingChat] = useState(false)
|
const [isStartingChat, setIsStartingChat] = useState(false)
|
||||||
|
|
||||||
// Verificar se máquina está online (para tickets com machineId)
|
// Verificar se máquina está online (para tickets com machineId)
|
||||||
const hasMachine = Boolean(ticket.machineId)
|
const hasMachine = Boolean(ticketMachineId)
|
||||||
const machineOnline = liveChatSession?.machineOnline ?? false
|
const machineOnline = liveChatSession?.machineOnline ?? false
|
||||||
const hasActiveSession = Boolean(liveChatSession?.sessionId)
|
const hasActiveSession = Boolean(liveChatSession?.sessionId)
|
||||||
const ticketHasAssignee = Boolean(ticket.assignee)
|
const ticketHasAssignee = Boolean(ticket.assignee)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue