fix(web): i18n race condition in load function (#10693)
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import { authenticate } from '$lib/utils/auth';
|
||||
import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAllPeople } from '@immich/sdk';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { get } from 'svelte/store';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
|
||||
const people = await getAllPeople({ withHidden: true });
|
||||
const $t = get(t);
|
||||
const $t = await getFormatter();
|
||||
|
||||
return {
|
||||
people,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { authenticate } from '$lib/utils/auth';
|
||||
import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import { getPerson, getPersonStatistics } from '@immich/sdk';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { get } from 'svelte/store';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
@@ -13,7 +12,7 @@ export const load = (async ({ params }) => {
|
||||
getPersonStatistics({ id: params.personId }),
|
||||
getAssetInfoFromParam(params),
|
||||
]);
|
||||
const $t = get(t);
|
||||
const $t = await getFormatter();
|
||||
|
||||
return {
|
||||
person,
|
||||
|
||||
Reference in New Issue
Block a user