Skip to content

Commit

Permalink
Implemented suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamish-taylor committed May 15, 2024
1 parent 39710f0 commit 34de6cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [3.1.1]

### Added
- Added a ping to tell Raygun that raygun4js has been set up correctly, this information will be used to help users when setting up a new application. This can be diasbled using the new `sendPing` option E.g. `rg4js('sendPing', false)`.
- Added a ping to tell Raygun that raygun4js has been set up correctly, this information will be used to help users when setting up a new application. This can be disabled using the new `sendPing` option e.g., `rg4js('sendPing', false)`.
- Moved the typescript types into the main raygun4js repo

## [3.0.1]
Expand Down
11 changes: 9 additions & 2 deletions src/raygun.loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

var metadata = {
ping : {
sendPing : false,
sendPing : true,
pingIntervalId : -1,
failedPings : 0
},
Expand Down Expand Up @@ -250,7 +250,14 @@
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
}).then(function(response) {
if (response.ok) {
metadata.ping.failedPings = 0;
} else {
// Request failed
metadata.ping.failedPings++;
}
})
.catch(function() {
metadata.ping.failedPings++;
});
Expand Down

0 comments on commit 34de6cb

Please sign in to comment.