Skip to content

Commit

Permalink
close #688, remove legacy counter
Browse files Browse the repository at this point in the history
A previous patch has refactored the canvas image loading process
and it does not use <img /> anymore, so the counter is no longer
need.

commit: 4a72ff0b3cdf9920ea38bca8f69eedbfe52c99904a0036f3fc1cd7c1e0248a37R725
  • Loading branch information
Yuyz0112 committed Sep 2, 2021
1 parent e9db702 commit b068241
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions packages/rrweb/src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,8 +818,6 @@ export class Replayer {
};
this.emitter.on(ReplayerEvents.Start, stateHandler);
this.emitter.on(ReplayerEvents.Pause, stateHandler);
let count = 0;
let resolved = 0;
for (const event of this.service.state.context.events) {
if (
event.type === EventType.IncrementalSnapshot &&
Expand All @@ -828,7 +826,6 @@ export class Replayer {
typeof event.data.args[0] === 'string' &&
!this.imageMap.has(event)
) {
count++;
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const imgd = ctx?.createImageData(canvas.width, canvas.height);
Expand All @@ -837,9 +834,6 @@ export class Replayer {
ctx?.putImageData(imgd!, 0, 0);
}
}
if (count !== resolved) {
this.service.send({ type: 'PAUSE' });
}
}

private applyIncremental(
Expand Down

0 comments on commit b068241

Please sign in to comment.