Skip to content

Commit 17db534

Browse files
authored
Merge pull request #382 from wavect/wsdt/registration-safety
fix: Waiting for previous start action to complete
2 parents 49d3386 + 1c3bef0 commit 17db534

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

mobile/tasks/location.task.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,22 @@ export class OBackgroundLocationService {
107107
}
108108

109109
this.locationSubscription = BackgroundGeolocation.onLocation(
110-
async (location) => {
110+
(location) => {
111111
Sentry.captureMessage(
112112
`Captured locationUpdate in location service: ${JSON.stringify(location?.coords)}`,
113113
);
114-
await this.saveLocation(
114+
115+
// TODO: we might want to include altitude in future too?
116+
this.saveLocation(
115117
location?.coords?.latitude,
116118
location?.coords?.longitude,
117-
); // TODO: we might want to include altitude in future too?
119+
).catch((error) => {
120+
Sentry.captureException(error, {
121+
tags: { location_service: "saveLocation:fail" },
122+
});
123+
});
118124
},
119-
async (error) => {
125+
(error) => {
120126
Sentry.captureException(error, {
121127
tags: { location_service: "onLocation:onFailure" },
122128
});

0 commit comments

Comments
 (0)