From b35434d9cd77e0de311cbd867dcbf59642da6436 Mon Sep 17 00:00:00 2001 From: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> Date: Tue, 28 May 2024 15:00:27 -0700 Subject: [PATCH] ts --- packages/rrweb/src/replay/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/rrweb/src/replay/index.ts b/packages/rrweb/src/replay/index.ts index dbfc3c302b..27a07d31c2 100644 --- a/packages/rrweb/src/replay/index.ts +++ b/packages/rrweb/src/replay/index.ts @@ -425,8 +425,7 @@ export class Replayer { this.service.state.context.events.forEach((e: eventWithTime) => { if (indicatesTouchDevice(e)) { const d = e.data; - const pointerId = - 'pointerId' in d && d.pointerId !== undefined ? d.pointerId : -1; + const pointerId = 'pointerId' in d && d.pointerId ? d.pointerId : -1; if (!this.pointers[pointerId]) { this.createPointer(pointerId); @@ -584,8 +583,7 @@ export class Replayer { : (rawEvent as eventWithTime); if (indicatesTouchDevice(event)) { const d = event.data; - const pointerId = - 'pointerId' in d && d.pointerId !== undefined ? d.pointerId : -1; + const pointerId = 'pointerId' in d && d.pointerId ? d.pointerId : -1; if (!this.pointers[pointerId]) { this.createPointer(pointerId); } @@ -1130,8 +1128,7 @@ export class Replayer { case IncrementalSource.Drag: case IncrementalSource.TouchMove: case IncrementalSource.MouseMove: { - const pointerId = - 'pointerId' in d && d.pointerId !== undefined ? d.pointerId : -1; + const pointerId = 'pointerId' in d && d.pointerId ? d.pointerId : -1; if (!this.pointers[pointerId]) { this.createPointer(pointerId); }