diff --git a/ui/js/component/fileActions/index.js b/ui/js/component/fileActions/index.js index a570cd413..e9dc10705 100644 --- a/ui/js/component/fileActions/index.js +++ b/ui/js/component/fileActions/index.js @@ -16,6 +16,9 @@ import { import { selectCurrentModal, } from 'selectors/app' +import { + makeSelectCostInfoForUri, +} from 'selectors/cost_info' import { doCloseModal, doOpenModal, @@ -39,6 +42,7 @@ const makeSelect = () => { const selectFileInfoForUri = makeSelectFileInfoForUri() const selectIsAvailableForUri = makeSelectIsAvailableForUri() const selectDownloadingForUri = makeSelectDownloadingForUri() + const selectCostInfoForUri = makeSelectCostInfoForUri() const select = (state, props) => ({ fileInfo: selectFileInfoForUri(state, props), @@ -46,6 +50,7 @@ const makeSelect = () => { platform: selectPlatform(state), modal: selectCurrentModal(state), downloading: selectDownloadingForUri(state, props), + costInfo: selectCostInfoForUri(state, props), }) return select @@ -62,7 +67,7 @@ const perform = (dispatch) => ({ }, openModal: (modal) => dispatch(doOpenModal(modal)), startDownload: (uri) => dispatch(doPurchaseUri(uri)), - loadVideo: (uri) => dispatch(doLoadVideo(uri)) + loadVideo: (uri) => dispatch(doLoadVideo(uri)), }) export default connect(makeSelect, perform)(FileActions) \ No newline at end of file diff --git a/ui/js/component/fileActions/view.jsx b/ui/js/component/fileActions/view.jsx index 4924d059d..7f3c1d75c 100644 --- a/ui/js/component/fileActions/view.jsx +++ b/ui/js/component/fileActions/view.jsx @@ -62,6 +62,7 @@ class FileActions extends React.Component { openModal, closeModal, startDownload, + costInfo, } = this.props const deleteChecked = this.state.deleteChecked, @@ -99,8 +100,11 @@ class FileActions extends React.Component { } else if (fileInfo === null && !downloading) { - - content = { startDownload(uri) } } />; + if (!costInfo) { + content = + } else { + content = { startDownload(uri) } } />; + } } else if (fileInfo && fileInfo.download_path) { content = openInShell(fileInfo)} />;