This commit is contained in:
Manav Rathi
2024-10-07 10:00:41 +05:30
parent b1c30417ba
commit 46134b3b9a
2 changed files with 6 additions and 7 deletions

View File

@@ -85,7 +85,7 @@ const SelectedFileOptions = ({
onCreateCollection: showCreateCollectionModal(
COLLECTION_OPS_TYPE.ADD,
),
ignoredCollectionID:
relatedCollectionID:
isInSearchMode || peopleMode ? undefined : activeCollectionID,
});
@@ -158,7 +158,7 @@ const SelectedFileOptions = ({
onCreateCollection: showCreateCollectionModal(
COLLECTION_OPS_TYPE.MOVE,
),
ignoredCollectionID:
relatedCollectionID:
isInSearchMode || peopleMode ? undefined : activeCollectionID,
});
};

View File

@@ -59,11 +59,10 @@ export interface CollectionSelectorAttributes {
onCancel?: () => void;
/**
* Some actions, like "add" and "move", happen in the context of an existing
* collection. In such cases, their ID can be set as the
* {@link ignoredCollectionID} to omit showing them again in the list of
* collections.
* collection. In such cases, the ID of this collection can be set as the
* {@link relatedCollectionID} to omit showing it in the list again.
*/
ignoredCollectionID?: number | undefined;
relatedCollectionID?: number | undefined;
}
type CollectionSelectorProps = DialogVisibilityProps & {
@@ -111,7 +110,7 @@ export const CollectionSelector: React.FC<CollectionSelectorProps> = ({
const collections = [...collectionSummaries.values()]
.filter(({ id, type }) => {
if (id === attributes.ignoredCollectionID) {
if (id === attributes.relatedCollectionID) {
return false;
} else if (attributes.action == "add") {
return canAddToCollection(type);