diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte index 988707cfa7413..e5b1377965ee2 100644 --- a/web/src/lib/components/asset-viewer/asset-viewer.svelte +++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte @@ -32,7 +32,7 @@ type AssetResponseDto, type StackResponseDto, } from '@immich/sdk'; - import { onDestroy, onMount } from 'svelte'; + import { onDestroy, onMount, untrack } from 'svelte'; import { t } from 'svelte-i18n'; import { fly } from 'svelte/transition'; import Thumbnail from '../assets/thumbnail/thumbnail.svelte'; @@ -120,9 +120,11 @@ stack = null; } - if (stack && stack?.assets.length > 1) { - preloadAssets.push(stack.assets[1]); - } + untrack(() => { + if (stack && stack?.assets.length > 1) { + preloadAssets.push(stack.assets[1]); + } + }); }; const handleAddComment = () => {