2024-08-25 18:34:08 -04:00
|
|
|
import { retrieveServerConfig } from '$lib/stores/server-config.store';
|
|
|
|
|
import { initLanguage } from '$lib/utils';
|
|
|
|
|
import { defaults } from '@immich/sdk';
|
|
|
|
|
import { memoize } from 'lodash-es';
|
|
|
|
|
|
2024-09-05 14:29:41 -04:00
|
|
|
type Fetch = typeof fetch;
|
2024-08-25 18:34:08 -04:00
|
|
|
|
2024-09-05 14:29:41 -04:00
|
|
|
async function _init(fetch: Fetch) {
|
2024-08-25 18:34:08 -04:00
|
|
|
// set event.fetch on the fetch-client used by @immich/sdk
|
|
|
|
|
// https://kit.svelte.dev/docs/load#making-fetch-requests
|
|
|
|
|
// https://github.com/oazapfts/oazapfts/blob/main/README.md#fetch-options
|
|
|
|
|
defaults.fetch = fetch;
|
|
|
|
|
await initLanguage();
|
|
|
|
|
await retrieveServerConfig();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const init = memoize(_init, () => 'singlevalue');
|