fix low level issues

This commit is contained in:
Davide Scaini
2026-03-31 23:22:12 +02:00
parent 8f91503cf7
commit 81438231b4
19 changed files with 126 additions and 44 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ interface Props {
}
const { title = 'BincioActivity', description = 'Your personal activity stats' } = Astro.props;
const editUrl = import.meta.env.PUBLIC_EDIT_URL ?? '';
const baseUrl = import.meta.env.BASE_URL ?? '/';
---
<!doctype html>
<html lang="en" data-theme="dark">
@@ -174,7 +175,7 @@ const editUrl = import.meta.env.PUBLIC_EDIT_URL ?? '';
</script>
{editUrl && (
<script define:vars={{ editUrl }}>
<script define:vars={{ editUrl, baseUrl }}>
const modal = document.getElementById('upload-modal');
const drop = document.getElementById('upload-drop');
const input = document.getElementById('upload-input');
@@ -217,7 +218,7 @@ const editUrl = import.meta.env.PUBLIC_EDIT_URL ?? '';
const d = await r.json();
status.textContent = 'Done! Opening activity…';
status.style.color = '#4ade80';
setTimeout(() => { window.location.href = `/activity/${d.id}/`; }, 600);
setTimeout(() => { window.location.href = `${baseUrl}activity/${d.id}/`; }, 600);
} catch (e) {
status.textContent = 'Error: ' + e.message;
status.style.color = '#f87171';