1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00

fix(web): delete non-empty album (#12937)

This commit is contained in:
Jason Rasmussen 2024-09-25 16:54:42 -04:00 committed by GitHub
parent b2f2be3485
commit ad0dbf0315
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -169,12 +169,13 @@
const handleToggleEnableActivity = async () => { const handleToggleEnableActivity = async () => {
try { try {
album = await updateAlbumInfo({ await updateAlbumInfo({
id: album.id, id: album.id,
updateAlbumDto: { updateAlbumDto: {
isActivityEnabled: !album.isActivityEnabled, isActivityEnabled: !album.isActivityEnabled,
}, },
}); });
await refreshAlbum();
notificationController.show({ notificationController.show({
type: NotificationType.Info, type: NotificationType.Info,
message: $t('activity_changed', { values: { enabled: album.isActivityEnabled } }), message: $t('activity_changed', { values: { enabled: album.isActivityEnabled } }),
@ -277,7 +278,7 @@
}; };
const refreshAlbum = async () => { const refreshAlbum = async () => {
album = await getAlbumInfo({ id: album.id, withoutAssets: true }); data.album = await getAlbumInfo({ id: album.id, withoutAssets: true });
}; };
const handleAddAssets = async () => { const handleAddAssets = async () => {
@ -330,12 +331,13 @@
const handleAddUsers = async (albumUsers: AlbumUserAddDto[]) => { const handleAddUsers = async (albumUsers: AlbumUserAddDto[]) => {
try { try {
album = await addUsersToAlbum({ await addUsersToAlbum({
id: album.id, id: album.id,
addUsersDto: { addUsersDto: {
albumUsers, albumUsers,
}, },
}); });
await refreshAlbum();
viewMode = ViewMode.VIEW; viewMode = ViewMode.VIEW;
} catch (error) { } catch (error) {