fix: properly fix asset-viewer delete action, add tests (#25149)

Update timeline manager before nav, add e2e regression tests
This commit is contained in:
Min Idzelis
2026-01-09 09:20:42 -05:00
committed by GitHub
parent 573e9b0d52
commit 4d559a63ec
3 changed files with 208 additions and 21 deletions

View File

@@ -119,14 +119,15 @@
case AssetAction.ARCHIVE:
case AssetAction.SET_VISIBILITY_LOCKED:
case AssetAction.SET_VISIBILITY_TIMELINE: {
// must update manager before performing any navigation
timelineManager.removeAssets([action.asset.id]);
// find the next asset to show or close the viewer
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
(await handleNavigateToAsset(assetCursor?.nextAsset)) ||
(await handleNavigateToAsset(assetCursor?.previousAsset)) ||
(await handleClose(action.asset));
// delete after find the next one
timelineManager.removeAssets([action.asset.id]);
break;
}
}