chore(immich): drop the IMMICH_URL hook
A deployment no longer suggests an address for the first server: every address is each account's own and is typed in the app, so the field opens blank with a placeholder. The env var, its compose passthrough, the example line and the `defaultUrl` field that carried it are all gone; the backend's config route now answers with the saved list alone.
This commit is contained in:
@@ -87,16 +87,16 @@ async function get<T>(path: string): Promise<T | null> {
|
||||
}
|
||||
}
|
||||
|
||||
// The saved servers, plus the address this deployment suggests for the first one.
|
||||
// One call per session: the tree has to draw on the first paint, and a server
|
||||
// list that is asked for on every render is a round trip per render.
|
||||
let configOnce: Promise<{ defaultUrl: string; servers: ImmichServer[] }> | null = null;
|
||||
// The saved servers. One call per session: the tree has to draw on the first
|
||||
// paint, and a server list that is asked for on every render is a round trip per
|
||||
// render.
|
||||
let configOnce: Promise<{ servers: ImmichServer[] }> | null = null;
|
||||
|
||||
export function immichConfig(fresh = false): Promise<{ defaultUrl: string; servers: ImmichServer[] }> {
|
||||
export function immichConfig(fresh = false): Promise<{ servers: ImmichServer[] }> {
|
||||
if (fresh || !configOnce) {
|
||||
configOnce = get<{ defaultUrl?: string; servers?: ImmichServer[] }>('/api/immich/config').then((body) =>
|
||||
body ? { defaultUrl: body.defaultUrl ?? '', servers: body.servers ?? [] } : { defaultUrl: '', servers: [] }
|
||||
);
|
||||
configOnce = get<{ servers?: ImmichServer[] }>('/api/immich/config').then((body) => ({
|
||||
servers: body?.servers ?? [],
|
||||
}));
|
||||
}
|
||||
return configOnce;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user