17018: Fixes the bug adding checks for readonly context menu type.
[arvados-workbench2.git] / src / views-components / context-menu / actions / download-collection-file-action.tsx
index 3e4e4a0ba7929418ebc80694768716eb072d4c4d..e1986d3cd338454551cc46b9563405d097257ab2 100644 (file)
@@ -13,7 +13,9 @@ import { sanitizeToken } from "./helpers";
 const mapStateToProps = (state: RootState) => {
     const { resource } = state.contextMenu;
     const currentCollectionUuid = state.collectionPanel.item ? state.collectionPanel.item.uuid : '';
 const mapStateToProps = (state: RootState) => {
     const { resource } = state.contextMenu;
     const currentCollectionUuid = state.collectionPanel.item ? state.collectionPanel.item.uuid : '';
-    if (resource && resource.menuKind === ContextMenuKind.COLLECTION_FILES_ITEM) {
+    if (resource && (
+        resource.menuKind === ContextMenuKind.COLLECTION_FILES_ITEM ||
+        resource.menuKind === ContextMenuKind.READONLY_COLLECTION_FILES_ITEM)) {
         const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
         if (file) {
             return {
         const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
         if (file) {
             return {