File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,21 +43,21 @@ export default function Events(
4343 } ;
4444
4545 this . startTracking = function ( callback : Function | null ) : void {
46- if ( ! mpInstance . _Store . isTracking ) {
47- if ( 'geolocation' in navigator ) {
48- mpInstance . _Store . watchPositionId = navigator . geolocation . watchPosition (
49- successTracking ,
50- errorTracking
51- ) ;
52- }
53- } else {
46+ if ( mpInstance . _Store . isTracking ) {
5447 const position = {
5548 coords : {
5649 latitude : mpInstance . _Store . currentPosition . lat ,
5750 longitude : mpInstance . _Store . currentPosition . lng ,
5851 } ,
5952 } ;
6053 triggerCallback ( callback , position ) ;
54+ } else {
55+ if ( 'geolocation' in navigator ) {
56+ mpInstance . _Store . watchPositionId = navigator . geolocation . watchPosition (
57+ successTracking ,
58+ errorTracking
59+ ) ;
60+ }
6161 }
6262
6363 function successTracking ( position : GeolocationPosition ) : void {
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import {
1010 MessageType ,
1111} from './config/constants' ;
1212import { IMParticleInstanceManager } from '../../src/sdkRuntimeModels' ;
13- import { TransactionAttributes } from '@mparticle/web-sdk' ;
1413
1514declare global {
1615 interface Window {
You can’t perform that action at this time.
0 commit comments