1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-07 20:36:48 +01:00

fix(web): stacked vs normal asset rendering

This commit is contained in:
Alex Tran 2023-10-27 20:57:37 -05:00
parent a42c95a781
commit 51dc197b33

View file

@ -57,7 +57,6 @@
let shouldShowDetailButton = asset.hasMetadata; let shouldShowDetailButton = asset.hasMetadata;
let canCopyImagesToClipboard: boolean; let canCopyImagesToClipboard: boolean;
let previewStackedAsset: AssetResponseDto | undefined; let previewStackedAsset: AssetResponseDto | undefined;
$: displayedAsset = previewStackedAsset || asset;
$: { $: {
if (asset.stackCount && asset.stack) { if (asset.stackCount && asset.stack) {
@ -471,17 +470,15 @@
<NavigationArea on:click={navigateAssetBackward}><Icon path={mdiChevronLeft} size="36" /></NavigationArea> <NavigationArea on:click={navigateAssetBackward}><Icon path={mdiChevronLeft} size="36" /></NavigationArea>
</div> </div>
{/if} {/if}
<!-- Asset Viewer --> <!-- Asset Viewer -->
<div class="col-span-4 col-start-1 row-span-full row-start-1"> <div class="col-span-4 col-start-1 row-span-full row-start-1">
<!-- Condition to show preview of stacked asset on hovered --> {#if previewStackedAsset}
{#if displayedAsset} {#key previewStackedAsset.id}
{#key displayedAsset.id} {#if previewStackedAsset.type === AssetTypeEnum.Image}
{#if displayedAsset.type === AssetTypeEnum.Image} <PhotoViewer asset={previewStackedAsset} on:close={closeViewer} haveFadeTransition={false} />
<PhotoViewer asset={displayedAsset} on:close={closeViewer} haveFadeTransition={false} />
{:else} {:else}
<VideoViewer <VideoViewer
assetId={displayedAsset.id} assetId={previewStackedAsset.id}
on:close={closeViewer} on:close={closeViewer}
on:onVideoEnded={handleVideoEnded} on:onVideoEnded={handleVideoEnded}
on:onVideoStarted={handleVideoStarted} on:onVideoStarted={handleVideoStarted}