unify single user and multi user behaviour
This commit is contained in:
@@ -161,10 +161,16 @@ export async function loadActivity(
|
||||
/**
|
||||
* Load athlete profile. Athlete data is not stored locally yet, so this is
|
||||
* always a network fetch with a graceful null on failure.
|
||||
*
|
||||
* @param baseUrl Site base URL (used to build the default path)
|
||||
* @param athleteUrl Explicit full URL — use for per-user pages in multi-user mode
|
||||
*/
|
||||
export async function loadAthlete(baseUrl: string): Promise<Record<string, unknown> | null> {
|
||||
export async function loadAthlete(
|
||||
baseUrl: string,
|
||||
athleteUrl?: string,
|
||||
): Promise<Record<string, unknown> | null> {
|
||||
try {
|
||||
return await fetchJSON(`${baseUrl}data/athlete.json`);
|
||||
return await fetchJSON(athleteUrl ?? `${baseUrl}data/athlete.json`);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user