Merge branch '16812-token-appears-in-the-download-URL'
[arvados-workbench2.git] / src / views-components / context-menu / actions / collection-file-viewer-action.tsx
index 0a202daf21085513acc2ae62f00c43e866393d4c..f75da23869666e248fe1f04d91cd0e500f0e1a21 100644 (file)
@@ -6,7 +6,6 @@ import { connect } from "react-redux";
 import { RootState } from "../../../store/store";
 import { FileViewerAction } from '~/views-components/context-menu/actions/file-viewer-action';
 import { getNodeValue } from "~/models/tree";
-import { CollectionFileType } from "~/models/collection-file";
 import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
 
 const mapStateToProps = (state: RootState) => {
@@ -16,16 +15,15 @@ const mapStateToProps = (state: RootState) => {
         const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
         if (file) {
             return {
-                href: file.url,
-                download: file.type === CollectionFileType.DIRECTORY ? undefined : file.name,
+                href: file.url.replace(state.auth.config.keepWebServiceUrl, state.auth.config.keepWebInlineServiceUrl),
                 kind: 'file',
                 currentCollectionUuid
             };
         }
     } else {
-        return ;
+        return;
     }
-    return ;
+    return;
 };
 
 export const CollectionFileViewerAction = connect(mapStateToProps)(FileViewerAction);