refactor: address comments

This commit is contained in:
Catriel Müller
2026-05-06 14:01:53 -03:00
parent d04b357e9f
commit 622e1263d2
2 changed files with 6 additions and 4 deletions
@@ -128,11 +128,12 @@ export class KiloChatClient {
})
const next = prev.then(send, send)
this.sendQueues.set(req.conversationId, next)
void next.finally(() => {
const cleanup = () => {
if (this.sendQueues.get(req.conversationId) === next) {
this.sendQueues.delete(req.conversationId)
}
})
}
void next.then(cleanup, cleanup)
return next
}
@@ -119,11 +119,12 @@ export class KiloChatClient {
})
const next = prev.then(send, send)
this.sendQueues.set(req.conversationId, next)
void next.finally(() => {
const cleanup = () => {
if (this.sendQueues.get(req.conversationId) === next) {
this.sendQueues.delete(req.conversationId)
}
})
}
void next.then(cleanup, cleanup)
return next
}