Skip to content

Commit

Permalink
ts
Browse files Browse the repository at this point in the history
  • Loading branch information
michellewzhang committed May 28, 2024
1 parent c7039dd commit b35434d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/rrweb/src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit b35434d

Please sign in to comment.