mirror of
https://github.com/immich-app/immich.git
synced 2025-03-11 02:23:09 -05:00
fix(web): update recent album after edit (#15762)
* fix(web): update recent album after edit * chore: clean up --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
parent
b4a4abbf51
commit
f3ba994186
1 changed files with 11 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
locale,
|
||||
type AlbumViewSettings,
|
||||
} from '$lib/stores/preferences.store';
|
||||
import { userInteraction } from '$lib/stores/user.svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { AppRoute } from '$lib/constants';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
@ -293,6 +294,15 @@
|
|||
sharedAlbums[sharedAlbums.findIndex(({ id }) => id === album.id)] = album;
|
||||
};
|
||||
|
||||
const updateRecentAlbumInfo = (album: AlbumResponseDto) => {
|
||||
for (const cachedAlbum of userInteraction.recentAlbums || []) {
|
||||
if (cachedAlbum.id === album.id) {
|
||||
Object.assign(cachedAlbum, { ...cachedAlbum, ...album });
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const successEditAlbumInfo = (album: AlbumResponseDto) => {
|
||||
albumToEdit = null;
|
||||
|
||||
|
@ -308,6 +318,7 @@
|
|||
});
|
||||
|
||||
updateAlbumInfo(album);
|
||||
updateRecentAlbumInfo(album);
|
||||
};
|
||||
|
||||
const handleAddUsers = async (albumUsers: AlbumUserAddDto[]) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue