From c25859cee9d260528a0db1aca32b5f128d85b148 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 19 Nov 2025 00:57:45 +0200 Subject: [PATCH] client/debouncer: report pending updates before destroying --- apps/client/src/utils/debouncer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } }