fix(web): apply changes to cursor.current instead of asset (#25136)

This commit is contained in:
Brandon Wees 2026-01-08 16:31:41 -05:00 committed by GitHub
parent 471fab0591
commit 85b0b97ef2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -105,7 +105,7 @@
const stackThumbnailSize = 60; const stackThumbnailSize = 60;
const stackSelectedThumbnailSize = 65; const stackSelectedThumbnailSize = 65;
let asset = $derived(cursor.current); const asset = $derived(cursor.current);
let appearsInAlbums: AlbumResponseDto[] = $state([]); let appearsInAlbums: AlbumResponseDto[] = $state([]);
let sharedLink = getSharedLink(); let sharedLink = getSharedLink();
let previewStackedAsset: AssetResponseDto | undefined = $state(); let previewStackedAsset: AssetResponseDto | undefined = $state();
@ -312,7 +312,7 @@
case AssetAction.REMOVE_ASSET_FROM_STACK: { case AssetAction.REMOVE_ASSET_FROM_STACK: {
stack = action.stack; stack = action.stack;
if (stack) { if (stack) {
asset = stack.assets[0]; cursor.current = stack.assets[0];
} }
break; break;
} }
@ -323,11 +323,11 @@
} }
case AssetAction.SET_PERSON_FEATURED_PHOTO: { case AssetAction.SET_PERSON_FEATURED_PHOTO: {
const assetInfo = await getAssetInfo({ id: asset.id }); const assetInfo = await getAssetInfo({ id: asset.id });
asset = { ...asset, people: assetInfo.people }; cursor.current = { ...asset, people: assetInfo.people };
break; break;
} }
case AssetAction.RATING: { case AssetAction.RATING: {
asset = { cursor.current = {
...asset, ...asset,
exifInfo: { exifInfo: {
...asset.exifInfo, ...asset.exifInfo,
@ -394,7 +394,7 @@
const onAssetUpdate = (update: AssetResponseDto) => { const onAssetUpdate = (update: AssetResponseDto) => {
if (asset.id === update.id) { if (asset.id === update.id) {
asset = update; cursor.current = update;
} }
}; };
</script> </script>
@ -590,7 +590,7 @@
dimmed={stackedAsset.id !== asset.id} dimmed={stackedAsset.id !== asset.id}
asset={toTimelineAsset(stackedAsset)} asset={toTimelineAsset(stackedAsset)}
onClick={() => { onClick={() => {
asset = stackedAsset; cursor.current = stackedAsset;
previewStackedAsset = undefined; previewStackedAsset = undefined;
}} }}
onMouseEvent={({ isMouseOver }) => handleStackedAssetMouseEvent(isMouseOver, stackedAsset)} onMouseEvent={({ isMouseOver }) => handleStackedAssetMouseEvent(isMouseOver, stackedAsset)}