mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
fix(web): timeline scroll when pressing back from stacked asset (#28163)
This commit is contained in:
parent
bf32864644
commit
65bd0a9320
2 changed files with 7 additions and 7 deletions
|
|
@ -67,7 +67,7 @@
|
|||
preAction?: PreAction;
|
||||
onAction?: OnAction;
|
||||
onUndoDelete?: OnUndoDelete;
|
||||
onClose?: (asset: AssetResponseDto) => void;
|
||||
onClose?: (assetId: string) => void;
|
||||
onRemoveFromAlbum?: (assetIds: string[]) => void;
|
||||
onRandom?: () => Promise<{ id: string } | undefined>;
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@
|
|||
});
|
||||
|
||||
const closeViewer = () => {
|
||||
onClose?.(asset);
|
||||
onClose?.(asset.id);
|
||||
};
|
||||
|
||||
const closeEditor = async () => {
|
||||
|
|
@ -474,7 +474,7 @@
|
|||
onAction={handleAction}
|
||||
{onUndoDelete}
|
||||
onPlaySlideshow={() => ($slideshowState = SlideshowState.PlaySlideshow)}
|
||||
onClose={onClose ? () => onClose(asset) : undefined}
|
||||
onClose={onClose ? () => onClose(stack?.primaryAssetId ?? asset.id) : undefined}
|
||||
{onRemoveFromAlbum}
|
||||
{playOriginalVideo}
|
||||
{setPlayOriginalVideo}
|
||||
|
|
|
|||
|
|
@ -96,9 +96,9 @@
|
|||
return { id: randomAsset.id };
|
||||
};
|
||||
|
||||
const handleClose = async (asset: { id: string }) => {
|
||||
const handleClose = async (assetId: string) => {
|
||||
invisible = true;
|
||||
assetViewerManager.gridScrollTarget = { at: asset.id };
|
||||
assetViewerManager.gridScrollTarget = { at: assetId };
|
||||
await navigate({
|
||||
targetRoute: 'current',
|
||||
assetId: null,
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
(await navigateToAsset(assetCursor?.nextAsset)) ||
|
||||
(await navigateToAsset(assetCursor?.previousAsset)) ||
|
||||
(await handleClose(assetCursor.current));
|
||||
(await handleClose(assetCursor.current.id));
|
||||
};
|
||||
|
||||
const handlePreAction = async (action: Action) => {
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
(await navigateToAsset(assetCursor?.nextAsset)) ||
|
||||
(await navigateToAsset(assetCursor?.previousAsset)) ||
|
||||
(await handleClose(action.asset));
|
||||
(await handleClose(action.asset.id));
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue