don't debounce, only sub once
This commit is contained in:
parent
b2f89db129
commit
327f5ee9fe
1 changed files with 8 additions and 4 deletions
|
|
@ -913,6 +913,8 @@ class Mediator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSentRequestsSubbed = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Readonly<{ token: string }>} body
|
* @param {Readonly<{ token: string }>} body
|
||||||
*/
|
*/
|
||||||
|
|
@ -922,16 +924,18 @@ class Mediator {
|
||||||
|
|
||||||
await throwOnInvalidToken(token)
|
await throwOnInvalidToken(token)
|
||||||
|
|
||||||
API.Events.onSimplerSentRequests(
|
if (!this.onSentRequestsSubbed) {
|
||||||
debounce(sentRequests => {
|
this.onSentRequestsSubbed = true
|
||||||
|
|
||||||
|
API.Events.onSimplerSentRequests(sentRequests => {
|
||||||
console.log(`new Reqss in mediator: ${JSON.stringify(sentRequests)}`)
|
console.log(`new Reqss in mediator: ${JSON.stringify(sentRequests)}`)
|
||||||
this.socket.emit(Event.ON_SENT_REQUESTS, {
|
this.socket.emit(Event.ON_SENT_REQUESTS, {
|
||||||
msg: sentRequests,
|
msg: sentRequests,
|
||||||
ok: true,
|
ok: true,
|
||||||
origBody: body
|
origBody: body
|
||||||
})
|
})
|
||||||
}, 1000)
|
})
|
||||||
)
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
this.socket.emit(Event.ON_SENT_REQUESTS, {
|
this.socket.emit(Event.ON_SENT_REQUESTS, {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue