unify single user and multi user behaviour
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user