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