mirror of
https://github.com/immich-app/immich.git
synced 2025-12-26 09:14:58 +03:00
refactor: albums-list (#23765)
This commit is contained in:
@@ -1,6 +1,21 @@
|
||||
import { downloadArchive } from '$lib/utils/asset-utils';
|
||||
import { getFormatter } from '$lib/utils/i18n';
|
||||
import type { AlbumResponseDto } from '@immich/sdk';
|
||||
import { modalManager } from '@immich/ui';
|
||||
|
||||
export const handleDownloadAlbum = async (album: AlbumResponseDto) => {
|
||||
await downloadArchive(`${album.albumName}.zip`, { albumId: album.id });
|
||||
};
|
||||
|
||||
export const handleConfirmAlbumDelete = async (album: AlbumResponseDto) => {
|
||||
const $t = await getFormatter();
|
||||
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 modalManager.showDialog({ prompt });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user