sdk: only send events if we have any

This commit is contained in:
Carl-Gerhard Lindesvärd
2023-11-01 20:49:31 +01:00
parent f7ccafbda0
commit bbbc16be25

View File

@@ -111,8 +111,11 @@ class Batcher<T extends any> {
if(this.timer) {
clearTimeout(this.timer)
}
this.callback(this.queue)
this.queue = []
if(this.queue.length > 0) {
this.callback(this.queue)
this.queue = []
}
}
}