fix(web): show a clearer confirmation message when deleting an unnamed album (#11988)

* fix(web): show a different confirmation message when deleting an unnamed album

* Rename the function

* Fix formatting
This commit is contained in:
Snowknight26 2024-08-24 23:59:18 -05:00 committed by GitHub
parent 843345df4f
commit 7a4fccb1b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 10 deletions

View file

@ -1,4 +1,5 @@
import { goto } from '$app/navigation';
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import { AppRoute } from '$lib/constants';
import {
AlbumFilter,
@ -199,3 +200,16 @@ export const collapseAllAlbumGroups = (groupIds: string[]) => {
export const expandAllAlbumGroups = () => {
collapseAllAlbumGroups([]);
};
export const confirmAlbumDelete = async (album: AlbumResponseDto) => {
const $t = get(t);
const confirmation =
album.albumName.length > 0
? $t('album_delete_confirmation', { values: { album: album.albumName } })
: $t('unnamed_album_delete_confirmation');
const description = $t('album_delete_confirmation_description');
const prompt = `${confirmation} ${description}`;
return dialogController.show({ prompt });
};