diff --git a/bincio/dev.py b/bincio/dev.py index 8bf87fd..24b5292 100644 --- a/bincio/dev.py +++ b/bincio/dev.py @@ -148,8 +148,10 @@ def dev( env = { **os.environ, "BINCIO_DATA_DIR": str(data), - "PUBLIC_EDIT_URL": "", # empty = proxy /api/* to bincio serve - "VITE_API_PORT": str(api_port), # picked up by astro.config.mjs if needed + "PUBLIC_EDIT_URL": "", # empty = proxy /api/* to bincio serve + "PUBLIC_EDIT_ENABLED": "true" if has_auth else "", # show edit/upload UI in VPS mode + "PUBLIC_MOBILE_APP": "", # Record/Convert tabs off by default + "VITE_API_PORT": str(api_port), # picked up by astro.config.mjs } # Start astro dev in foreground (Ctrl+C stops everything) diff --git a/site/src/components/ActivityDetail.svelte b/site/src/components/ActivityDetail.svelte index e5cfd1f..ea242f8 100644 --- a/site/src/components/ActivityDetail.svelte +++ b/site/src/components/ActivityDetail.svelte @@ -13,7 +13,8 @@ export let base: string = '/'; export let athlete: AthleteZones | null = null; - const editUrl = import.meta.env.PUBLIC_EDIT_URL; + const editUrl = import.meta.env.PUBLIC_EDIT_URL ?? ''; + const editEnabled = editUrl !== '' || import.meta.env.PUBLIC_EDIT_ENABLED === 'true'; let detail: ActivityDetail | null = null; let error = ''; @@ -89,7 +90,7 @@ -{#if editOpen && editUrl} +{#if editOpen && editEnabled} editOpen = false} /> {/if} @@ -176,7 +177,7 @@

{displayTitle}

- {#if editUrl} + {#if editEnabled} - {editUrl && ( + {editEnabled && (