prefix /api/metrics on android. fixes #1159

This commit is contained in:
Danny Coates 2019-02-19 10:46:16 -08:00
parent a42cec97f3
commit 41bfe31d61
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
2 changed files with 25 additions and 19 deletions

View file

@ -390,3 +390,14 @@ export async function setFileList(bearerToken, data) {
});
return response.ok;
}
export function sendMetrics(blob) {
if (!navigator.sendBeacon) {
return;
}
try {
navigator.sendBeacon(getApiUrl('/api/metrics'), blob);
} catch (e) {
console.error(e);
}
}