mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(web): prevent fetching asset info twice (#8486)
This commit is contained in:
parent
0529076ed7
commit
66650f5944
8 changed files with 47 additions and 61 deletions
|
|
@ -1,16 +1,18 @@
|
|||
import type { AssetResponseDto } from '@immich/sdk';
|
||||
|
||||
export class SlideshowHistory {
|
||||
private history: string[] = [];
|
||||
private history: AssetResponseDto[] = [];
|
||||
private index = 0;
|
||||
|
||||
constructor(private onChange: (assetId: string) => void) {}
|
||||
constructor(private onChange: (asset: AssetResponseDto) => void) {}
|
||||
|
||||
reset() {
|
||||
this.history = [];
|
||||
this.index = 0;
|
||||
}
|
||||
|
||||
queue(assetId: string) {
|
||||
this.history.push(assetId);
|
||||
queue(asset: AssetResponseDto) {
|
||||
this.history.push(asset);
|
||||
|
||||
// If we were at the end of the slideshow history, move the index to the new end
|
||||
if (this.index === this.history.length - 2) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue