From 9ac1f97e400eac3b52e2ff78bfa53ae29e7db319 Mon Sep 17 00:00:00 2001 From: Ananddubey01 Date: Tue, 31 Jan 2023 21:49:59 +0530 Subject: [PATCH] CollectionOptions: Refactored delete options names --- .../Collections/CollectionOptions/index.tsx | 12 +++++++----- src/components/Sidebar/ShortcutSection.tsx | 4 +--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/Collections/CollectionOptions/index.tsx b/src/components/Collections/CollectionOptions/index.tsx index 2d3a4f605..92a178f27 100644 --- a/src/components/Collections/CollectionOptions/index.tsx +++ b/src/components/Collections/CollectionOptions/index.tsx @@ -41,7 +41,7 @@ export enum CollectionActions { UNARCHIVE, CONFIRM_DELETE, DELETE, - KEEP_FILES, + DELETE_BUT_KEEP_FILES, SHOW_SHARE_DIALOG, CONFIRM_EMPTY_TRASH, EMPTY_TRASH, @@ -92,8 +92,8 @@ const CollectionOptions = (props: CollectionOptionsProps) => { case CollectionActions.DELETE: callback = deleteCollection; break; - case CollectionActions.KEEP_FILES: - callback = keepFiles; + case CollectionActions.DELETE_BUT_KEEP_FILES: + callback = deleteButkeepFiles; break; case CollectionActions.SHOW_SHARE_DIALOG: callback = showCollectionShareModal; @@ -147,7 +147,7 @@ const CollectionOptions = (props: CollectionOptionsProps) => { redirectToAll(); }; - const keepFiles = async () => { + const deleteButkeepFiles = async () => { const allFiles = await getLocalFiles(); const collectionFiles = allFiles.filter((file) => { return file.collectionID === activeCollection.id; @@ -204,7 +204,9 @@ const CollectionOptions = (props: CollectionOptionsProps) => { }, secondary: { text: constants.KEEP_PHOTOS, - action: handleCollectionAction(CollectionActions.KEEP_FILES), + action: handleCollectionAction( + CollectionActions.DELETE_BUT_KEEP_FILES + ), variant: 'primary', }, close: { diff --git a/src/components/Sidebar/ShortcutSection.tsx b/src/components/Sidebar/ShortcutSection.tsx index 6d62b924e..9aa940873 100644 --- a/src/components/Sidebar/ShortcutSection.tsx +++ b/src/components/Sidebar/ShortcutSection.tsx @@ -27,9 +27,7 @@ export default function ShortcutSection({ main(); }, []); - const openUncategorizedSection = async () => { - // const uncategorisedCollection = await getUncategorizedCollection(); - // unCategorizedCollectionId.current = uncategorisedCollection.id; + const openUncategorizedSection = () => { galleryContext.setActiveCollection(unCategorizedCollectionId); closeSidebar(); };