1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

fix(web): update album information when sliding images (#1378)

This commit is contained in:
Zlendy 2023-01-22 04:26:58 +01:00 committed by GitHub
parent 05b79eb77b
commit e5d798581c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,17 +36,23 @@
onMount(async () => {
document.addEventListener('keydown', onKeyboardPress);
getAllAlbums();
});
onDestroy(() => {
document.removeEventListener('keydown', onKeyboardPress);
});
$: asset.id && getAllAlbums(); // Update the album information when the asset ID changes
const getAllAlbums = async () => {
try {
const { data } = await api.albumApi.getAllAlbums(undefined, asset.id);
appearsInAlbums = data;
} catch (e) {
console.error('Error getting album that asset belong to', e);
}
});
onDestroy(() => {
document.removeEventListener('keydown', onKeyboardPress);
});
}
const handleKeyboardPress = (key: string) => {
switch (key) {