mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
chore: Refactor Edit Album Modal (#18653)
This commit is contained in:
@@ -8,12 +8,10 @@
|
||||
|
||||
interface Props {
|
||||
album: AlbumResponseDto;
|
||||
onEditSuccess?: ((album: AlbumResponseDto) => unknown) | undefined;
|
||||
onCancel?: (() => unknown) | undefined;
|
||||
onClose: () => void;
|
||||
onClose: (album?: AlbumResponseDto) => void;
|
||||
}
|
||||
|
||||
let { album = $bindable(), onEditSuccess = undefined, onCancel = undefined, onClose }: Props = $props();
|
||||
let { album = $bindable(), onClose }: Props = $props();
|
||||
|
||||
let albumName = $state(album.albumName);
|
||||
let description = $state(album.description);
|
||||
@@ -32,7 +30,7 @@
|
||||
});
|
||||
album.albumName = albumName;
|
||||
album.description = description;
|
||||
onEditSuccess?.(album);
|
||||
onClose(album);
|
||||
} catch (error) {
|
||||
handleError(error, $t('errors.unable_to_update_album_info'));
|
||||
} finally {
|
||||
@@ -71,7 +69,7 @@
|
||||
|
||||
<ModalFooter>
|
||||
<div class="flex gap-2 w-full">
|
||||
<Button shape="round" color="secondary" fullWidth onclick={() => onCancel?.()}>{$t('cancel')}</Button>
|
||||
<Button shape="round" color="secondary" fullWidth onclick={() => onClose()}>{$t('cancel')}</Button>
|
||||
<Button shape="round" type="submit" fullWidth disabled={isSubmitting} form="edit-album-form">{$t('save')}</Button>
|
||||
</div>
|
||||
</ModalFooter>
|
||||
|
||||
Reference in New Issue
Block a user