fix(tickets): guard linkedTicket fetch with currentChatRef to prevent race condition
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -247,7 +247,10 @@ export default function AssistantChatPage() {
|
||||
setActivePsaTicketId(detail.psa_ticket_id)
|
||||
if (detail.psa_ticket_id) {
|
||||
integrationsApi.getTicket(detail.psa_ticket_id)
|
||||
.then(setLinkedTicket)
|
||||
.then(ticket => {
|
||||
if (currentChatRef.current !== chatId) return
|
||||
setLinkedTicket(ticket)
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
setLinkedTicket(null)
|
||||
|
||||
Reference in New Issue
Block a user