mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
prefix /api/metrics on android. fixes #1159
This commit is contained in:
11
app/api.js
11
app/api.js
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user