mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
fix: album title state weirdness (#12874)
This commit is contained in:
parent
af8f3774d0
commit
b45fce8ddf
2 changed files with 10 additions and 4 deletions
|
@ -7,6 +7,7 @@
|
||||||
export let id: string;
|
export let id: string;
|
||||||
export let albumName: string;
|
export let albumName: string;
|
||||||
export let isOwned: boolean;
|
export let isOwned: boolean;
|
||||||
|
export let onUpdate: (albumName: string) => void;
|
||||||
|
|
||||||
$: newAlbumName = albumName;
|
$: newAlbumName = albumName;
|
||||||
|
|
||||||
|
@ -16,17 +17,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await updateAlbumInfo({
|
({ albumName } = await updateAlbumInfo({
|
||||||
id,
|
id,
|
||||||
updateAlbumDto: {
|
updateAlbumDto: {
|
||||||
albumName: newAlbumName,
|
albumName: newAlbumName,
|
||||||
},
|
},
|
||||||
});
|
}));
|
||||||
|
onUpdate(albumName);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, $t('errors.unable_to_save_album'));
|
handleError(error, $t('errors.unable_to_save_album'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
albumName = newAlbumName;
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -589,7 +589,12 @@
|
||||||
{#if viewMode !== ViewMode.SELECT_THUMBNAIL}
|
{#if viewMode !== ViewMode.SELECT_THUMBNAIL}
|
||||||
<!-- ALBUM TITLE -->
|
<!-- ALBUM TITLE -->
|
||||||
<section class="pt-8 md:pt-24">
|
<section class="pt-8 md:pt-24">
|
||||||
<AlbumTitle id={album.id} bind:albumName={album.albumName} {isOwned} />
|
<AlbumTitle
|
||||||
|
id={album.id}
|
||||||
|
albumName={album.albumName}
|
||||||
|
{isOwned}
|
||||||
|
onUpdate={(albumName) => (album.albumName = albumName)}
|
||||||
|
/>
|
||||||
|
|
||||||
{#if album.assetCount > 0}
|
{#if album.assetCount > 0}
|
||||||
<AlbumSummary {album} />
|
<AlbumSummary {album} />
|
||||||
|
|
Loading…
Reference in a new issue