fix(web): update stack state in timeline ()

* fix(web): update stack state in timeline

* js docs

* fix: handle state update from unstack action from gallery viewer

* use navigate in View Stack notification

---------

Co-authored-by: Snowknight26 <Snowknight26@users.noreply.github.com>
This commit is contained in:
Alex 2025-03-21 12:42:36 -05:00 committed by GitHub
parent b00da18e84
commit b5d5c40c69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 78 additions and 22 deletions
web/src/lib/components/photos-page

View file

@ -9,7 +9,7 @@
import { isSearchEnabled } from '$lib/stores/search.store';
import { featureFlags } from '$lib/stores/server-config.store';
import { handlePromiseError } from '$lib/utils';
import { deleteAssets } from '$lib/utils/actions';
import { deleteAssets, updateStackedAssetInTimeline, updateUnstackedAssetInTimeline } from '$lib/utils/actions';
import { archiveAssets, cancelMultiselect, selectAllAssets, stackAssets } from '$lib/utils/asset-utils';
import { navigate } from '$lib/utils/navigation';
import { type ScrubberListener } from '$lib/utils/timeline-util';
@ -310,11 +310,11 @@
};
const onStackAssets = async () => {
const ids = await stackAssets(assetInteraction.selectedAssets);
if (ids) {
assetStore.removeAssets(ids);
onEscape();
}
const result = await stackAssets(assetInteraction.selectedAssets);
updateStackedAssetInTimeline(assetStore, result);
onEscape();
};
const toggleArchive = async () => {
@ -411,7 +411,7 @@
}
case AssetAction.UNSTACK: {
assetStore.addAssets(action.assets);
updateUnstackedAssetInTimeline(assetStore, action.assets);
}
}
};