Skip to content

Commit

Permalink
Merge pull request #11 from abridger/master
Browse files Browse the repository at this point in the history
Prevent unload event sending empty arrays
  • Loading branch information
russormes authored Dec 15, 2017
2 parents a4c5b20 + 05528be commit 34246c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kwc-tracking.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@
*/
function _handleUnload () {
window.removeEventListener('unload', _handleUnload);
if (!queue.length) {
return;
}
try {
let client = new XMLHttpRequest(),
url = `${config.API_URL}/track/${schema}`,
Expand Down

0 comments on commit 34246c7

Please sign in to comment.