albums: fix deletion message
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/807/merge
parent
6d3fa7d27b
commit
62bbe2470a
|
@ -218,8 +218,16 @@ export async function* deletePhotos(photos: IPhoto[], confirm: boolean = true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show confirmation dialog if required
|
// Show confirmation dialog if required
|
||||||
if (confirm && !(await utils.dialogs.moveToTrash(photos.length))) {
|
if (confirm) {
|
||||||
throw new Error('User cancelled deletion');
|
if (routeIsAlbums) {
|
||||||
|
if (!(await utils.dialogs.removeFromAlbum(photos.length))) {
|
||||||
|
throw new Error('User cancelled removal');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!(await utils.dialogs.moveToTrash(photos.length))) {
|
||||||
|
throw new Error('User cancelled deletion');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete local files.
|
// Delete local files.
|
||||||
|
|
|
@ -92,6 +92,14 @@ export const dialogs = {
|
||||||
message: t('memories', 'Files in trash may be automatically deleted after a fixed period of time.'),
|
message: t('memories', 'Files in trash may be automatically deleted after a fixed period of time.'),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
removeFromAlbum: (count: number) =>
|
||||||
|
confirmDestructive({
|
||||||
|
title: n('memories', 'Remove {count} item from album?', 'Remove {count} items from album?', count, {
|
||||||
|
count,
|
||||||
|
}),
|
||||||
|
message: t('memories', 'This will not delete your original files.'),
|
||||||
|
}),
|
||||||
|
|
||||||
downloadItems: (count: number) =>
|
downloadItems: (count: number) =>
|
||||||
confirmDestructive({
|
confirmDestructive({
|
||||||
title: t('memories', 'Download'),
|
title: t('memories', 'Download'),
|
||||||
|
|
Loading…
Reference in New Issue