diff --git a/ui/js/actions/availability.js b/ui/js/actions/availability.js index 2c7cbc3cb..4cde9d2ed 100644 --- a/ui/js/actions/availability.js +++ b/ui/js/actions/availability.js @@ -4,6 +4,11 @@ import { selectFetchingAvailability } from "selectors/availability"; export function doFetchAvailability(uri) { return function(dispatch, getState) { + /* + this is disabled atm - Jeremy + */ + return; + const state = getState(); const alreadyFetching = !!selectFetchingAvailability(state)[uri]; diff --git a/ui/js/actions/file_info.js b/ui/js/actions/file_info.js index eb317e484..49c949e5c 100644 --- a/ui/js/actions/file_info.js +++ b/ui/js/actions/file_info.js @@ -71,18 +71,18 @@ export function doFileList() { }; } -export function doOpenFileInShell(fileInfo) { +export function doOpenFileInShell(path) { return function(dispatch, getState) { - const success = shell.openItem(fileInfo.download_path); + const success = shell.openItem(path); if (!success) { - dispatch(doOpenFileInFolder(fileInfo)); + dispatch(doOpenFileInFolder(path)); } }; } -export function doOpenFileInFolder(fileInfo) { +export function doOpenFileInFolder(path) { return function(dispatch, getState) { - shell.showItemInFolder(fileInfo.download_path); + shell.showItemInFolder(path); }; } diff --git a/ui/js/component/fileDetails/index.js b/ui/js/component/fileDetails/index.js index 385959ed2..738746d0a 100644 --- a/ui/js/component/fileDetails/index.js +++ b/ui/js/component/fileDetails/index.js @@ -6,11 +6,18 @@ import { makeSelectMetadataForUri, } from "selectors/claims"; import FileDetails from "./view"; +import { doOpenFileInFolder } from "actions/file_info"; +import { makeSelectFileInfoForUri } from "selectors/file_info"; const select = (state, props) => ({ claim: makeSelectClaimForUri(props.uri)(state), contentType: makeSelectContentTypeForUri(props.uri)(state), + fileInfo: makeSelectFileInfoForUri(props.uri)(state), metadata: makeSelectMetadataForUri(props.uri)(state), }); -export default connect(select, null)(FileDetails); +const perform = dispatch => ({ + openFolder: path => dispatch(doOpenFileInFolder(path)), +}); + +export default connect(select, perform)(FileDetails); diff --git a/ui/js/component/fileDetails/view.jsx b/ui/js/component/fileDetails/view.jsx index dfcc47699..c2cfda468 100644 --- a/ui/js/component/fileDetails/view.jsx +++ b/ui/js/component/fileDetails/view.jsx @@ -5,9 +5,18 @@ import FileActions from "component/fileActions"; import Link from "component/link"; import DateTime from "component/dateTime"; +const path = require("path"); + class FileDetails extends React.PureComponent { render() { - const { claim, contentType, metadata, uri } = this.props; + const { + claim, + contentType, + fileInfo, + metadata, + openFolder, + uri, + } = this.props; if (!claim || !metadata) { return ( @@ -20,6 +29,9 @@ class FileDetails extends React.PureComponent { const { description, language, license } = metadata; const { height } = claim; const mediaType = lbry.getMediaType(contentType); + const directory = fileInfo && fileInfo.download_path + ? path.dirname(fileInfo.download_path) + : null; return (
diff --git a/ui/js/component/fileDownloadLink/index.js b/ui/js/component/fileDownloadLink/index.js index 9843a1701..2131b5f78 100644 --- a/ui/js/component/fileDownloadLink/index.js +++ b/ui/js/component/fileDownloadLink/index.js @@ -10,7 +10,6 @@ import { doFetchAvailability } from "actions/availability"; import { doOpenFileInShell } from "actions/file_info"; import { doPurchaseUri, doStartDownload } from "actions/content"; import FileDownloadLink from "./view"; -import * as modals from "constants/modal_types"; const select = (state, props) => ({ fileInfo: makeSelectFileInfoForUri(props.uri)(state), @@ -22,7 +21,7 @@ const select = (state, props) => ({ const perform = dispatch => ({ checkAvailability: uri => dispatch(doFetchAvailability(uri)), - openInShell: fileInfo => dispatch(doOpenFileInShell(fileInfo)), + openInShell: path => dispatch(doOpenFileInShell(path)), purchaseUri: uri => dispatch(doPurchaseUri(uri)), restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)), }); diff --git a/ui/js/component/fileDownloadLink/view.jsx b/ui/js/component/fileDownloadLink/view.jsx index 1a0a8dc1c..49c6c29ce 100644 --- a/ui/js/component/fileDownloadLink/view.jsx +++ b/ui/js/component/fileDownloadLink/view.jsx @@ -92,7 +92,7 @@ class FileDownloadLink extends React.PureComponent { label={__("Open")} button="text" icon="icon-external-link-square" - onClick={() => openInShell(fileInfo)} + onClick={() => openInShell(fileInfo.download_path)} /> ); } diff --git a/ui/js/page/show/view.jsx b/ui/js/page/show/view.jsx index 679626d28..8b1e05789 100644 --- a/ui/js/page/show/view.jsx +++ b/ui/js/page/show/view.jsx @@ -36,6 +36,7 @@ class ShowPage extends React.PureComponent { message={__("Loading magic decentralized data...")} />} {claim === null && + !isResolvingUri && {__("There's nothing at this location.")} }