Skip to content

Commit

Permalink
Merge pull request #192 from radarlabs/start-tracking-verified-try
Browse files Browse the repository at this point in the history
Catch `trackVerified()` errors in `startTrackingVerified()`, change location timeout to 10 seconds
  • Loading branch information
nickpatrick authored Nov 26, 2024
2 parents 058d4fe + 9e2c6f1 commit 3fa9f21
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ });
Add the following script in your `html` file
```html
<script src="https://js.radar.com/v4.4.7/radar.min.js"></script>
<script src="https://js.radar.com/v4.4.8/radar.min.js"></script>
```

Then initialize the Radar SDK
Expand All @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then
```html
<html>
<head>
<link href="https://js.radar.com/v4.4.7/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.7/radar.min.js"></script>
<link href="https://js.radar.com/v4.4.8/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.8/radar.min.js"></script>
</head>

<body>
Expand All @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis
```html
<html>
<head>
<link href="https://js.radar.com/v4.4.7/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.7/radar.min.js"></script>
<link href="https://js.radar.com/v4.4.8/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.8/radar.min.js"></script>
</head>

<body>
Expand Down Expand Up @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper
```html
<html>
<head>
<link href="https://js.radar.com/v4.4.7/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.7/radar.min.js"></script>
<link href="https://js.radar.com/v4.4.8/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.8/radar.min.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "radar-sdk-js",
"version": "4.4.7",
"version": "4.4.8",
"description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.",
"homepage": "https://radar.com",
"type": "module",
Expand Down
9 changes: 7 additions & 2 deletions src/api/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ class VerifyAPI {

static async startTrackingVerified(params: RadarStartTrackingVerifiedParams) {
const doTrackVerified = async () => {
const trackRes = await this.trackVerified(params);

let trackRes;
try {
trackRes = await this.trackVerified(params);
} catch (err: any) {
Logger.error(`trackVerified error: ${err.message}`);
}

const { interval } = params;

let expiresIn = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/navigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface PositionOptionOverrides {

const DEFAULT_POSITION_OPTIONS: PositionOptions = {
maximumAge: 0,
timeout: 1000 * 30, // 30 seconds
timeout: 1000 * 10, // 10 seconds
enableHighAccuracy: true,
};

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '4.4.7';
export default '4.4.8';

0 comments on commit 3fa9f21

Please sign in to comment.