1
0
mirror of synced 2026-01-04 18:06:26 -05:00

Merge pull request #7893 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2021-07-03 06:06:18 +10:00
committed by GitHub

View File

@@ -103,8 +103,13 @@ export function sendEvent({ type, version = '1.0.0', ...props }: SendEventProps)
...props,
}
const blob = new Blob([JSON.stringify(body)], { type: 'application/json' })
navigator.sendBeacon('/events', blob)
// Only send the beacon if the feature is not disabled in the user's browser
if (navigator?.sendBeacon) {
const blob = new Blob([JSON.stringify(body)], { type: 'application/json' })
navigator.sendBeacon('/events', blob)
}
return body
}