diff --git a/apps/client/src/utils/debouncer.ts b/apps/client/src/utils/debouncer.ts index b37c4118a..9057d039f 100644 --- a/apps/client/src/utils/debouncer.ts +++ b/apps/client/src/utils/debouncer.ts @@ -14,12 +14,15 @@ export default class Debouncer { updateValue(value: T) { this.lastValue = value; - this.destroy(); + if (this.timeoutId !== null) { + clearTimeout(this.timeoutId); + } this.timeoutId = setTimeout(this.reportUpdate.bind(this), this.debounceInterval); } destroy() { if (this.timeoutId !== null) { + this.reportUpdate(); clearTimeout(this.timeoutId); } }