unify single user and multi user behaviour

This commit is contained in:
Davide Scaini
2026-04-09 08:58:35 +02:00
parent 2007f53580
commit 98c42dc443
25 changed files with 678 additions and 232 deletions
+6 -2
View File
@@ -7,6 +7,10 @@
import { loadIndex, loadAthlete } from '../lib/dataloader';
export let base: string = '/';
/** Explicit index URL for multi-user per-user pages (user's shard). */
export let indexUrl: string = '';
/** Explicit athlete.json URL for multi-user per-user pages. */
export let athleteUrl: string = '';
let athlete: AthleteJson | null = null;
let activities: ActivitySummary[] = [];
@@ -34,8 +38,8 @@
mounted = true;
try {
const [athleteData, index] = await Promise.all([
loadAthlete(import.meta.env.BASE_URL),
loadIndex(import.meta.env.BASE_URL),
loadAthlete(import.meta.env.BASE_URL, athleteUrl || undefined),
loadIndex(import.meta.env.BASE_URL, indexUrl || undefined),
]);
if (!athleteData) throw new Error('athlete.json not found — run bincio extract first');
athlete = athleteData;