Skip to content

Commit

Permalink
chore: unflake 'should record'
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Sep 30, 2024
1 parent c67a733 commit 1402313
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { isUnderTest } from '../../utils/debug';

export class RecorderCollection extends EventEmitter {
private _actions: actions.ActionInContext[] = [];
private _lastFiredActionIndex = -1;
private _enabled = false;
private _pageAliases: Map<Page, string>;

Expand Down Expand Up @@ -126,6 +127,9 @@ export class RecorderCollection extends EventEmitter {
}

private _fireChange() {
if (this._actions.length === this._lastFiredActionIndex)
return;
this._lastFiredActionIndex = this._actions.length;
this.emit('change', collapseActions(this._actions));
}
}

0 comments on commit 1402313

Please sign in to comment.