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
+4 -1
View File
@@ -4,6 +4,9 @@
import { formatDistance, formatDuration, sportIcon, sportColor, sportLabel } from '../lib/format';
import { loadIndex } from '../lib/dataloader';
/** Explicit index URL — use for per-user stats pages in multi-user mode. */
export let indexUrl: string = '';
const PAGE_YEARS = 4;
let all: ActivitySummary[] = [];
@@ -31,7 +34,7 @@
page = parseInt(params.get('page') ?? '0', 10) || 0;
mounted = true;
try {
const index = await loadIndex(import.meta.env.BASE_URL);
const index = await loadIndex(import.meta.env.BASE_URL, indexUrl || undefined);
all = index.activities.filter(a => a.privacy !== 'private' && a.distance_m);
} catch (e: any) {
error = e.message;