File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/outsystems-wrapper/src Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,9 @@ class OSGeolocation {
106
106
}
107
107
error ( e )
108
108
}
109
+ const watchAddedCallback = ( callbackId : string ) => {
110
+ this . #callbackIdsMap[ watchId ] = callbackId ;
111
+ }
109
112
110
113
if ( options . timeout !== Infinity ) {
111
114
// If the timeout value was not set to Infinity (default), then
@@ -120,7 +123,7 @@ class OSGeolocation {
120
123
// For the case of watch location, capacitor returns a callback id that should be stored on the wrapper to make sure watches are cleared properly
121
124
// So in other words, Synapse can't be used in watchPosition for Capacitor.
122
125
// @ts -ignore
123
- let callbackId : string = Capacitor . Plugins . Geolocation . watchPosition (
126
+ Capacitor . Plugins . Geolocation . watchPosition (
124
127
options ,
125
128
( position : Position | OSGLOCPosition , err ?: any ) => {
126
129
if ( err ) {
@@ -130,8 +133,7 @@ class OSGeolocation {
130
133
successCallback ( position )
131
134
}
132
135
}
133
- ) ;
134
- this . #callbackIdsMap[ watchId ] = callbackId ;
136
+ ) . then ( watchAddedCallback ) ;
135
137
} else {
136
138
// @ts -ignore
137
139
cordova . plugins . Geolocation . watchPosition ( options , successCallback , errorCallback )
You can’t perform that action at this time.
0 commit comments