fix(browser): reset TimeBasedDebouncer state on dispose
dispose() cleared the pending timeout but left _refreshTimeoutID and _additionalRefreshRequested set. After dispose, a stale timeout id or trailing-refresh flag could confuse a new instance or tests. Match RenderDebouncer by clearing the timeout id and reset the trailing flag. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -31,7 +31,9 @@ export class TimeBasedDebouncer implements IRenderDebouncer {
|
|||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
if (this._refreshTimeoutID) {
|
if (this._refreshTimeoutID) {
|
||||||
clearTimeout(this._refreshTimeoutID);
|
clearTimeout(this._refreshTimeoutID);
|
||||||
|
this._refreshTimeoutID = undefined;
|
||||||
}
|
}
|
||||||
|
this._additionalRefreshRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {
|
public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user