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

@ -17,7 +17,7 @@
import { handleError } from '$lib/utils/handle-error';
import { downloadAlbum } from '$lib/utils/asset-utils';
import { normalizeSearchString } from '$lib/utils/string-utils';
import { getSelectedAlbumGroupOption, type AlbumGroup } from '$lib/utils/album-utils';
import { getSelectedAlbumGroupOption, type AlbumGroup, confirmAlbumDelete } from '$lib/utils/album-utils';
import type { ContextMenuPosition } from '$lib/utils/context-menu';
import { user } from '$lib/stores/user.store';
import {
@ -31,7 +31,6 @@
} from '$lib/stores/preferences.store';
import { goto } from '$app/navigation';
import { AppRoute } from '$lib/constants';
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import { t } from 'svelte-i18n';
export let ownedAlbums: AlbumResponseDto[] = [];
@ -302,9 +301,7 @@
return;
}
const isConfirmed = await dialogController.show({
prompt: $t('album_delete_confirmation', { values: { album: albumToDelete.albumName } }),
});
const isConfirmed = await confirmAlbumDelete(albumToDelete);
if (!isConfirmed) {
return;