1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-21 03:02:44 +01:00

fix(web): multiple fixes for the webUI (#8368)

fix: multiple fixes for the webUI
This commit is contained in:
martin 2024-03-30 16:14:41 +01:00 committed by GitHub
parent 4b39d37cae
commit 6a36bbd1d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -286,7 +286,15 @@
$restartSlideshowProgress = true; $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) { if ($slideshowState === SlideshowState.PlaySlideshow && $slideshowNavigation === SlideshowNavigation.Shuffle) {
return (order === 'previous' ? slideshowHistory.previous() : slideshowHistory.next()) || navigateAssetRandom(); return (order === 'previous' ? slideshowHistory.previous() : slideshowHistory.next()) || navigateAssetRandom();
} }
@ -446,12 +454,6 @@
} }
}; };
const handleVideoEnded = async () => {
if ($slideshowState === SlideshowState.PlaySlideshow) {
await navigateAsset('next');
}
};
const handlePlaySlideshow = async () => { const handlePlaySlideshow = async () => {
try { try {
await assetViewerHtmlElement.requestFullscreen(); await assetViewerHtmlElement.requestFullscreen();
@ -464,6 +466,7 @@
const handleStopSlideshow = async () => { const handleStopSlideshow = async () => {
try { try {
if (document.fullscreenElement) { if (document.fullscreenElement) {
document.body.style.cursor = '';
await document.exitFullscreen(); await document.exitFullscreen();
} }
} catch (error) { } catch (error) {
@ -588,7 +591,7 @@
<VideoViewer <VideoViewer
assetId={previewStackedAsset.id} assetId={previewStackedAsset.id}
on:close={closeViewer} on:close={closeViewer}
on:onVideoEnded={handleVideoEnded} on:onVideoEnded={() => navigateAsset()}
on:onVideoStarted={handleVideoStarted} on:onVideoStarted={handleVideoStarted}
/> />
{/if} {/if}
@ -621,7 +624,7 @@
<VideoViewer <VideoViewer
assetId={asset.id} assetId={asset.id}
on:close={closeViewer} on:close={closeViewer}
on:onVideoEnded={handleVideoEnded} on:onVideoEnded={() => navigateAsset()}
on:onVideoStarted={handleVideoStarted} on:onVideoStarted={handleVideoStarted}
/> />
{/if} {/if}