refactor: app init event (#17937)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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 },
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user