mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix: web search add to album reactivity (#13539)
This commit is contained in:
parent
57704ba5a7
commit
6b2f23b5a3
3 changed files with 17 additions and 3 deletions
|
|
@ -6,8 +6,10 @@
|
|||
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
|
||||
import { mdiImageAlbum, mdiShareVariantOutline } from '@mdi/js';
|
||||
import { t } from 'svelte-i18n';
|
||||
import type { OnAddToAlbum } from '$lib/utils/actions';
|
||||
|
||||
export let shared = false;
|
||||
export let onAddToAlbum: OnAddToAlbum = () => {};
|
||||
|
||||
let showAlbumPicker = false;
|
||||
|
||||
|
|
@ -21,13 +23,19 @@
|
|||
showAlbumPicker = false;
|
||||
|
||||
const assetIds = [...getAssets()].map((asset) => asset.id);
|
||||
await addAssetsToNewAlbum(albumName, assetIds);
|
||||
const album = await addAssetsToNewAlbum(albumName, assetIds);
|
||||
if (!album) {
|
||||
return;
|
||||
}
|
||||
|
||||
onAddToAlbum(assetIds, album.id);
|
||||
};
|
||||
|
||||
const handleAddToAlbum = async (album: AlbumResponseDto) => {
|
||||
showAlbumPicker = false;
|
||||
const assetIds = [...getAssets()].map((asset) => asset.id);
|
||||
await addAssetsToAlbum(album.id, assetIds);
|
||||
onAddToAlbum(assetIds, album.id);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue