Implemented Keep photos collection action
This commit is contained in:
parent
bb2b78d6ff
commit
b8faf0d22d
|
@ -40,6 +40,7 @@ export enum CollectionActions {
|
|||
UNARCHIVE,
|
||||
CONFIRM_DELETE,
|
||||
DELETE,
|
||||
KEEP_PHOTOS,
|
||||
SHOW_SHARE_DIALOG,
|
||||
CONFIRM_EMPTY_TRASH,
|
||||
EMPTY_TRASH,
|
||||
|
@ -90,6 +91,9 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
|
|||
case CollectionActions.DELETE:
|
||||
callback = deleteCollection;
|
||||
break;
|
||||
case CollectionActions.KEEP_PHOTOS:
|
||||
callback = keepPhotos;
|
||||
break;
|
||||
case CollectionActions.SHOW_SHARE_DIALOG:
|
||||
callback = showCollectionShareModal;
|
||||
break;
|
||||
|
@ -138,7 +142,12 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
|
|||
};
|
||||
|
||||
const deleteCollection = async () => {
|
||||
await CollectionAPI.deleteCollection(activeCollection.id);
|
||||
await CollectionAPI.deleteCollection(activeCollection.id, false);
|
||||
redirectToAll();
|
||||
};
|
||||
|
||||
const keepPhotos = async () => {
|
||||
await CollectionAPI.deleteCollection(activeCollection.id, true);
|
||||
redirectToAll();
|
||||
};
|
||||
|
||||
|
@ -177,7 +186,7 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
|
|||
const confirmDeleteCollection = () => {
|
||||
setDialogMessage({
|
||||
title: constants.DELETE_COLLECTION_TITLE,
|
||||
content: constants.DELETE_COLLECTION_MESSAGE,
|
||||
content: constants.DELETE_COLLECTION_MESSAGE(),
|
||||
proceed: {
|
||||
text: constants.DELETE_COLLECTION,
|
||||
action: handleCollectionAction(CollectionActions.DELETE),
|
||||
|
|
|
@ -368,8 +368,14 @@ const englishConstants = {
|
|||
DELETE_COLLECTION_TITLE: 'Delete album?',
|
||||
DELETE_COLLECTION: 'Delete album',
|
||||
DELETE_COLLECTION_FAILED: 'Album deletion failed, please try again',
|
||||
DELETE_COLLECTION_MESSAGE:
|
||||
'Files that are unique to this album will be moved to trash, and this album would be deleted.',
|
||||
DELETE_COLLECTION_MESSAGE: () => (
|
||||
<p>
|
||||
Also delete the photos (and videos) present in this album from
|
||||
<strong> all </strong> other albums they are part of?
|
||||
</p>
|
||||
),
|
||||
DELETE_PHOTOS: 'Delete photos',
|
||||
KEEP_PHOTOS: 'Keep photos',
|
||||
SHARE: 'Share',
|
||||
SHARE_COLLECTION: 'Share album',
|
||||
SHARE_WITH_PEOPLE: 'Share with your loved ones',
|
||||
|
|
Loading…
Reference in a new issue