Skip to content

Commit

Permalink
fix(rrweb): Do not re-initialize worker in CanvasManager.reset (#221)
Browse files Browse the repository at this point in the history
`reset()` gets called when we stop a recording in progress. There is no
reason to re-initialize the worker in `reset()` as you would need to
call `record()` to start recording again, which would start a new
worker. This was introduced in
#168.
  • Loading branch information
billyvg authored Oct 31, 2024
1 parent ddb3a56 commit d79bbf2
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions packages/rrweb/src/record/observers/canvas/canvas-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ export class CanvasManager implements CanvasManagerInterface {
this.worker?.terminate();
this.worker = null;
this.snapshotInProgressMap = new Map();
if (
(this.options.recordCanvas &&
typeof this.options.sampling === 'number') ||
this.options.enableManualSnapshot
) {
this.worker = this.initFPSWorker();
}
}

public freeze() {
Expand Down

0 comments on commit d79bbf2

Please sign in to comment.