mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	fix(web): update album information when sliding images (#1378)
This commit is contained in:
		| @@ -36,17 +36,23 @@ | |||||||
| 	onMount(async () => { | 	onMount(async () => { | ||||||
| 		document.addEventListener('keydown', onKeyboardPress); | 		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 { | 		try { | ||||||
| 			const { data } = await api.albumApi.getAllAlbums(undefined, asset.id); | 			const { data } = await api.albumApi.getAllAlbums(undefined, asset.id); | ||||||
| 			appearsInAlbums = data; | 			appearsInAlbums = data; | ||||||
| 		} catch (e) { | 		} catch (e) { | ||||||
| 			console.error('Error getting album that asset belong to', e); | 			console.error('Error getting album that asset belong to', e); | ||||||
| 		} | 		} | ||||||
| 	}); | 	} | ||||||
|  |  | ||||||
| 	onDestroy(() => { |  | ||||||
| 		document.removeEventListener('keydown', onKeyboardPress); |  | ||||||
| 	}); |  | ||||||
|  |  | ||||||
| 	const handleKeyboardPress = (key: string) => { | 	const handleKeyboardPress = (key: string) => { | ||||||
| 		switch (key) { | 		switch (key) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user