mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: Refactor Edit Album Modal (#18653)
This commit is contained in:
parent
8ea40973a7
commit
10181defb1
2 changed files with 11 additions and 23 deletions
|
|
@ -143,7 +143,6 @@
|
|||
|
||||
let albumGroupOption: string = $state(AlbumGroupBy.None);
|
||||
|
||||
let albumToEdit: AlbumResponseDto | null = $state(null);
|
||||
let albumToShare: AlbumResponseDto | null = $state(null);
|
||||
let albumToDelete: AlbumResponseDto | null = null;
|
||||
|
||||
|
|
@ -257,9 +256,14 @@
|
|||
await deleteSelectedAlbum();
|
||||
};
|
||||
|
||||
const handleEdit = (album: AlbumResponseDto) => {
|
||||
albumToEdit = album;
|
||||
const handleEdit = async (album: AlbumResponseDto) => {
|
||||
closeAlbumContextMenu();
|
||||
const editedAlbum = await modalManager.show(EditAlbumForm, {
|
||||
album,
|
||||
});
|
||||
if (editedAlbum) {
|
||||
successEditAlbumInfo(editedAlbum);
|
||||
}
|
||||
};
|
||||
|
||||
const deleteSelectedAlbum = async () => {
|
||||
|
|
@ -305,8 +309,6 @@
|
|||
};
|
||||
|
||||
const successEditAlbumInfo = (album: AlbumResponseDto) => {
|
||||
albumToEdit = null;
|
||||
|
||||
notificationController.show({
|
||||
message: $t('album_info_updated'),
|
||||
type: NotificationType.Info,
|
||||
|
|
@ -422,15 +424,3 @@
|
|||
<MenuOption icon={mdiDeleteOutline} text={$t('delete')} onClick={() => setAlbumToDelete()} />
|
||||
{/if}
|
||||
</RightClickContextMenu>
|
||||
|
||||
{#if allowEdit}
|
||||
<!-- Edit Modal -->
|
||||
{#if albumToEdit}
|
||||
<EditAlbumForm
|
||||
album={albumToEdit}
|
||||
onEditSuccess={successEditAlbumInfo}
|
||||
onCancel={() => (albumToEdit = null)}
|
||||
onClose={() => (albumToEdit = null)}
|
||||
/>
|
||||
{/if}
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue