1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-27 05:11:11 +02:00

fix(web): prevent fetching asset info twice (#8486)

This commit is contained in:
Michel Heusschen
2024-04-04 03:20:54 +02:00
committed by GitHub
parent 0529076ed7
commit 66650f5944
8 changed files with 47 additions and 61 deletions

View File

@ -62,7 +62,7 @@
let reactions: ActivityResponseDto[] = [];
const { setAssetId } = assetViewingStore;
const { setAsset } = assetViewingStore;
const {
restartProgress: restartSlideshowProgress,
stopProgress: stopSlideshowProgress,
@ -193,7 +193,7 @@
slideshowStateUnsubscribe = slideshowState.subscribe((value) => {
if (value === SlideshowState.PlaySlideshow) {
slideshowHistory.reset();
slideshowHistory.queue(asset.id);
slideshowHistory.queue(asset);
handlePromiseError(handlePlaySlideshow());
} else if (value === SlideshowState.StopSlideshow) {
handlePromiseError(handleStopSlideshow());
@ -203,7 +203,7 @@
shuffleSlideshowUnsubscribe = slideshowNavigation.subscribe((value) => {
if (value === SlideshowNavigation.Shuffle) {
slideshowHistory.reset();
slideshowHistory.queue(asset.id);
slideshowHistory.queue(asset);
}
});
@ -278,9 +278,9 @@
return;
}
slideshowHistory.queue(asset.id);
slideshowHistory.queue(asset);
await setAssetId(asset.id);
setAsset(asset);
$restartSlideshowProgress = true;
};
@ -299,9 +299,7 @@
if ($slideshowState === SlideshowState.PlaySlideshow && assetStore) {
const hasNext =
order === 'previous'
? await assetStore.getPreviousAssetId(asset.id)
: await assetStore.getNextAssetId(asset.id);
order === 'previous' ? await assetStore.getPreviousAsset(asset.id) : await assetStore.getNextAsset(asset.id);
if (hasNext) {
$restartSlideshowProgress = true;
} else {
@ -441,8 +439,8 @@
let assetViewerHtmlElement: HTMLElement;
const slideshowHistory = new SlideshowHistory((assetId: string) => {
handlePromiseError(setAssetId(assetId));
const slideshowHistory = new SlideshowHistory((asset) => {
setAsset(asset);
$restartSlideshowProgress = true;
});