fix(web): stop slideshow when pressing escape from asset viewer (#9929)

* fix(web): stop slideshow when pressing escape from asset viewer

* Fix formatting
This commit is contained in:
Snowknight26 2024-06-01 21:57:04 -05:00 committed by GitHub
parent 01f52c9021
commit 203cbbbfdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -273,10 +273,12 @@
};
const closeViewer = async () => {
$slideshowState = SlideshowState.StopSlideshow;
document.body.style.cursor = '';
dispatch('close');
await navigate({ targetRoute: 'current', assetId: null });
if ($slideshowState === SlideshowState.None) {
dispatch('close');
await navigate({ targetRoute: 'current', assetId: null });
} else {
$slideshowState = SlideshowState.StopSlideshow;
}
};
const navigateAssetRandom = async () => {