refactor: app init event (#17937)

This commit is contained in:
Jason Rasmussen
2025-04-28 14:48:33 -04:00
committed by GitHub
parent 895b2bf5cd
commit 7f69abbf0d
19 changed files with 81 additions and 75 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { getKey } from '$lib/utils';
import { authManager } from '$lib/managers/auth-manager.svelte';
import { type AssetGridRouteSearchParams } from '$lib/utils/navigation';
import { getAssetInfo, type AssetResponseDto } from '@immich/sdk';
import { readonly, writable } from 'svelte/store';
@@ -16,7 +16,7 @@ function createAssetViewingStore() {
};
const setAssetId = async (id: string): Promise<AssetResponseDto> => {
const asset = await getAssetInfo({ id, key: getKey() });
const asset = await getAssetInfo({ id, key: authManager.key });
setAsset(asset);
return asset;
};
+4 -4
View File
@@ -1,5 +1,4 @@
import { locale } from '$lib/stores/preferences.store';
import { getKey } from '$lib/utils';
import { CancellableTask } from '$lib/utils/cancellable-task';
import {
getJustifiedLayoutFromAssets,
@@ -21,6 +20,7 @@ import { clamp, debounce, isEqual, throttle } from 'lodash-es';
import { DateTime } from 'luxon';
import { t } from 'svelte-i18n';
import { authManager } from '$lib/managers/auth-manager.svelte';
import { SvelteSet } from 'svelte/reactivity';
import { get, writable, type Unsubscriber } from 'svelte/store';
import { handleError } from '../utils/handle-error';
@@ -839,7 +839,7 @@ export class AssetStore {
const timebuckets = await getTimeBuckets({
...this.#options,
size: TimeBucketSize.Month,
key: getKey(),
key: authManager.key,
});
this.buckets = timebuckets.map((bucket) => {
@@ -1047,7 +1047,7 @@ export class AssetStore {
...this.#options,
timeBucket: bucketDate,
size: TimeBucketSize.Month,
key: getKey(),
key: authManager.key,
},
{ signal },
);
@@ -1058,7 +1058,7 @@ export class AssetStore {
albumId: this.#options.timelineAlbumId,
timeBucket: bucketDate,
size: TimeBucketSize.Month,
key: getKey(),
key: authManager.key,
},
{ signal },
);