web: added saving method preference, made downloading resilient

This commit is contained in:
wukko
2024-07-28 18:59:58 +06:00
parent 87adffaf02
commit 5c780a2d2e
8 changed files with 56 additions and 43 deletions

View File

@@ -15,6 +15,12 @@ const installed = window.matchMedia('(display-mode: standalone)').matches;
const reducedMotion = window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;
const reducedTransparency = window.matchMedia(`(prefers-reduced-transparency: reduce)`).matches;
const app = {
is: {
installed
}
}
const device = {
is: {
iPhone,
@@ -28,13 +34,12 @@ const device = {
reducedMotion,
reducedTransparency,
},
supports: {
share: navigator.share !== undefined,
directDownload: !(installed && iOS),
},
userAgent: navigator.userAgent,
}
const app = {
is: {
installed
}
}
export { device, app };