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)
|
setActivePsaTicketId(detail.psa_ticket_id)
|
||||||
if (detail.psa_ticket_id) {
|
if (detail.psa_ticket_id) {
|
||||||
integrationsApi.getTicket(detail.psa_ticket_id)
|
integrationsApi.getTicket(detail.psa_ticket_id)
|
||||||
.then(setLinkedTicket)
|
.then(ticket => {
|
||||||
|
if (currentChatRef.current !== chatId) return
|
||||||
|
setLinkedTicket(ticket)
|
||||||
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
} else {
|
} else {
|
||||||
setLinkedTicket(null)
|
setLinkedTicket(null)
|
||||||
|
|||||||
Reference in New Issue
Block a user