You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+22-15Lines changed: 22 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,33 +15,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
16
16
### Added
17
17
18
-
- Support for on-device geofencing via new `HyperTrack.orders["my_order"].isInsideGeofence` property
18
+
- Support for on-device geofencing via new `HyperTrack.orders.get("my_order_handle").isInsideGeofence` property
19
19
- To learn more about how to best use this new feature see our guide here: [Verify shift presence before starting work](https://developer.hypertrack.com/docs/clock-in-out-tagging#verify-shift-presence-before-starting-work)
20
20
21
21
Example use for worker clock in:
22
22
23
23
```typescript
24
-
function handlePresence(isInsideResult:Result<boolean, LocationError>) {
25
-
switch (isInsideResult.type) {
26
-
case"success":
27
-
if (isInsideResult.value) {
24
+
// check worker presence synchronously
25
+
let activeOrders =awaitHyperTrack.getOrders()
26
+
let currentOrder =activeOrders.get("current_order")
27
+
if (currentOrder!==undefined) { handlePresence(currentOrder) }
28
+
else { console.log("'current_order' not found") }
29
+
30
+
// or subscribe to the changes in orders to get the status updates
0 commit comments