mirror of
https://github.com/immich-app/immich.git
synced 2026-04-26 19:09:56 -04:00
25 lines
881 B
TypeScript
25 lines
881 B
TypeScript
import { defaults } from '@immich/sdk';
|
|
import { memoize } from 'lodash-es';
|
|
import { authManager } from '$lib/managers/auth-manager.svelte';
|
|
import { featureFlagsManager } from '$lib/managers/feature-flags-manager.svelte';
|
|
import { serverConfigManager } from '$lib/managers/server-config-manager.svelte';
|
|
import { initLanguage } from '$lib/utils';
|
|
|
|
type Fetch = typeof fetch;
|
|
|
|
async function _init(fetch: Fetch) {
|
|
// 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 serverConfigManager.init();
|
|
await authManager.load();
|
|
|
|
if (!serverConfigManager.value.maintenanceMode) {
|
|
await featureFlagsManager.init();
|
|
}
|
|
}
|
|
|
|
export const init = memoize(_init, () => 'singlevalue');
|