mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 05:34:32 -04: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
@ -35,6 +35,7 @@
|
|||||||
locale,
|
locale,
|
||||||
type AlbumViewSettings,
|
type AlbumViewSettings,
|
||||||
} from '$lib/stores/preferences.store';
|
} from '$lib/stores/preferences.store';
|
||||||
|
import { userInteraction } from '$lib/stores/user.svelte';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { AppRoute } from '$lib/constants';
|
import { AppRoute } from '$lib/constants';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
@ -293,6 +294,15 @@
|
|||||||
sharedAlbums[sharedAlbums.findIndex(({ id }) => id === album.id)] = album;
|
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) => {
|
const successEditAlbumInfo = (album: AlbumResponseDto) => {
|
||||||
albumToEdit = null;
|
albumToEdit = null;
|
||||||
|
|
||||||
@ -308,6 +318,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
updateAlbumInfo(album);
|
updateAlbumInfo(album);
|
||||||
|
updateRecentAlbumInfo(album);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAddUsers = async (albumUsers: AlbumUserAddDto[]) => {
|
const handleAddUsers = async (albumUsers: AlbumUserAddDto[]) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user