15768: changed isSingle to fromContextMenu for clarity Arvados-DCO-1.1-Signed-off...
[arvados.git] / src / views-components / multiselect-toolbar / ms-collection-action-set.ts
index f6d7e7122b93166aa9bf3e98e35511efff93d131..b0a2a1b024793aafc8e86d269f468c7a49324862 100644 (file)
@@ -15,8 +15,8 @@ export const msCollectionActionSet: ContextMenuActionSet = [
         {
             icon: CopyIcon,
             name: "Make a copy",
-            execute: (dispatch, resources) => {
-                if (resources[0].isSingle || resources.length === 1) dispatch<any>(openCollectionCopyDialog(resources[0]));
+            execute: (dispatch, [...resources]) => {
+                if (resources[0].fromContextMenu || resources.length === 1) dispatch<any>(openCollectionCopyDialog(resources[0]));
                 else dispatch<any>(openMultiCollectionCopyDialog(resources[0]));
             },
         },
@@ -29,7 +29,7 @@ export const msCollectionActionSet: ContextMenuActionSet = [
             component: ToggleTrashAction,
             name: "ToggleTrashAction",
             execute: (dispatch, resources: ContextMenuResource[]) => {
-                for (const resource of resources) {
+                for (const resource of [...resources]) {
                     dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
                 }
             },