Skip to content

Commit

Permalink
fix(web): prevent infinite loop when modifying stacked asset (immich-…
Browse files Browse the repository at this point in the history
  • Loading branch information
michelheusschen authored and bdavis2-PCTY committed Nov 18, 2024
1 parent 5388944 commit d913896
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/src/lib/components/asset-viewer/asset-viewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 = () => {
Expand Down

0 comments on commit d913896

Please sign in to comment.