scope _enabled check to racy action

This commit is contained in:
Simon Knott 2024-11-29 16:09:23 +01:00
parent 4e33ade287
commit c454788592
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -79,7 +79,8 @@ export class RecorderCollection extends EventEmitter {
callMetadata.error = error ? serializeError(error) : undefined; callMetadata.error = error ? serializeError(error) : undefined;
// Do not wait for onAfterCall so that performAction returned immediately after the action. // Do not wait for onAfterCall so that performAction returned immediately after the action.
mainFrame.instrumentation.onAfterCall(mainFrame, callMetadata).then(() => { mainFrame.instrumentation.onAfterCall(mainFrame, callMetadata).then(() => {
this._fireChange(); if (this._enabled)
this._fireChange();
}).catch(() => {}); }).catch(() => {});
} }
@ -126,8 +127,6 @@ export class RecorderCollection extends EventEmitter {
} }
private _fireChange() { private _fireChange() {
if (!this._enabled)
return;
this.emit('change', collapseActions(this._actions)); this.emit('change', collapseActions(this._actions));
} }
} }