/* The phone's connection — for the one guard the desktop never needed: downloads kept to Wi-Fi when the switch says so (You → Downloads). Streaming is never refused: that is what a phone on the network is for. navigator.connection is Chrome's; a WebView without it reports nothing, and nothing is refused. */ import { settings } from "./prefs.svelte.js"; import { player } from "./player.svelte.js"; export const cellular = () => { const c = typeof navigator !== "undefined" ? navigator.connection : null; return !!c && c.type === "cellular"; }; export const NO_WIFI = "Downloads wait for Wi-Fi — the switch is under You → Downloads."; /** true when a download may start now; otherwise the reason is on the bar */ export function downloadsAllowed() { if (settings.wifiOnly && cellular()) { player.error = NO_WIFI; return false; } return true; }