close #688, remove legacy counter

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
This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 3577303979
commit 58209df0fc

View File

@@ -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 &&
@@ -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);
@@ -837,9 +834,6 @@ export class Replayer {
ctx?.putImageData(imgd!, 0, 0);
}
}
if (count !== resolved) {
this.service.send({ type: 'PAUSE' });
}
}
private applyIncremental(