diff --git a/src/components/pages/gallery/SelectedFileOptions.tsx b/src/components/pages/gallery/SelectedFileOptions.tsx index 5cbe34a8b..c8a0b9810 100644 --- a/src/components/pages/gallery/SelectedFileOptions.tsx +++ b/src/components/pages/gallery/SelectedFileOptions.tsx @@ -24,6 +24,7 @@ interface Props { setDialogMessage: SetDialogMessage; setCollectionSelectorAttributes: SetCollectionSelectorAttributes; deleteFileHelper: () => void; + removeFromCollectionHelper: () => void; count: number; clearSelection: () => void; archiveFilesHelper: () => void; @@ -58,6 +59,7 @@ const SelectedFileOptions = ({ addToCollectionHelper, moveToCollectionHelper, showCreateCollectionModal, + removeFromCollectionHelper, setDialogMessage, setCollectionSelectorAttributes, deleteFileHelper, @@ -94,7 +96,7 @@ const SelectedFileOptions = ({ content: constants.CONFIRM_REMOVE_MESSAGE, staticBackdrop: true, proceed: { - action: deleteFileHelper, + action: removeFromCollectionHelper, text: constants.REMOVE, variant: 'danger', }, diff --git a/src/pages/gallery/index.tsx b/src/pages/gallery/index.tsx index f75b87fef..d74e7c42d 100644 --- a/src/pages/gallery/index.tsx +++ b/src/pages/gallery/index.tsx @@ -73,6 +73,7 @@ import { COLLECTION_OPS_TYPE, isSharedCollection, handleCollectionOps, + getSelectedCollection, } from 'utils/collection'; import { logError } from 'utils/sentry'; @@ -595,6 +596,14 @@ export default function Gallery() { setCollectionSelectorAttributes } deleteFileHelper={deleteFileHelper} + removeFromCollectionHelper={() => + collectionOpsHelper(COLLECTION_OPS_TYPE.REMOVE)( + getSelectedCollection( + activeCollection, + collections + ) + ) + } count={selected.count} clearSelection={clearSelection} activeCollection={activeCollection} diff --git a/src/utils/collection/index.ts b/src/utils/collection/index.ts index a06f47614..5b303d643 100644 --- a/src/utils/collection/index.ts +++ b/src/utils/collection/index.ts @@ -39,6 +39,7 @@ export async function handleCollectionOps( ); break; case COLLECTION_OPS_TYPE.REMOVE: + // todo add remove logic break; default: throw Error(CustomError.INVALID_COLLECTION_OPERATION);