Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
martabal committed Mar 18, 2024
1 parent 1feb877 commit b96a07d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions web/src/lib/components/asset-viewer/asset-viewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,15 @@
$restartSlideshowProgress = true;
};
const navigateAsset = async (order: 'previous' | 'next', e?: Event) => {
const navigateAsset = async (order?: 'previous' | 'next', e?: Event) => {
if (!order) {
if ($slideshowState === SlideshowState.PlaySlideshow) {
order = $slideshowNavigation === SlideshowNavigation.AscendingOrder ? 'previous' : 'next';
} else {
return;
}
}
if ($slideshowState === SlideshowState.PlaySlideshow && $slideshowNavigation === SlideshowNavigation.Shuffle) {
return (order === 'previous' ? slideshowHistory.previous() : slideshowHistory.next()) || navigateAssetRandom();
}
Expand Down Expand Up @@ -445,14 +453,6 @@
}
};
const handleVideoEnded = async () => {
if ($slideshowState === SlideshowState.PlaySlideshow) {
$slideshowNavigation === SlideshowNavigation.AscendingOrder
? await navigateAsset('previous')
: await navigateAsset('next');
}
};
const handlePlaySlideshow = async () => {
try {
await assetViewerHtmlElement.requestFullscreen();
Expand Down Expand Up @@ -578,7 +578,7 @@
{:else}
<VideoViewer
assetId={previewStackedAsset.id}
onVideoEnd={handleVideoEnded}
onVideoEnd={() => navigateAsset()}
onVideoStart={handleVideoStarted}
/>
{/if}
Expand All @@ -604,7 +604,7 @@
<PhotoViewer {asset} {preloadAssets} on:close={closeViewer} />
{/if}
{:else}
<VideoViewer assetId={asset.id} onVideoEnd={handleVideoEnded} onVideoStart={handleVideoStarted} />
<VideoViewer assetId={asset.id} onVideoEnd={() => navigateAsset()} onVideoStart={handleVideoStarted} />
{/if}
{#if $slideshowState === SlideshowState.None && isShared && ((album && album.isActivityEnabled) || numberOfComments > 0)}
<div class="z-[9999] absolute bottom-0 right-0 mb-6 mr-6 justify-self-end">
Expand Down

0 comments on commit b96a07d

Please sign in to comment.