diff --git a/client/src/components/PublishPreview/index.jsx b/client/src/components/PublishPreview/index.jsx index 9f7240cf..817b5c8c 100644 --- a/client/src/components/PublishPreview/index.jsx +++ b/client/src/components/PublishPreview/index.jsx @@ -7,9 +7,11 @@ import Row from '@components/Row'; class PublishPreview extends React.Component { render () { + const { isUpdate, uri } = this.props; return (
+ {isUpdate && uri && (

{`Editing ${uri}`}

)}
{ +const mapStateToProps = props => { + const { show, publish } = props; + const asset = selectAsset(show); + let uri; + if (asset) { + uri = `lbry://${buildURI(asset)}`; + } return { disabled: publish.disabled, file : publish.file, status : publish.status.status, isUpdate: publish.isUpdate, + uri, }; }; diff --git a/client/src/containers/PublishTool/view.jsx b/client/src/containers/PublishTool/view.jsx index 6ba957fe..d62e60b2 100644 --- a/client/src/containers/PublishTool/view.jsx +++ b/client/src/containers/PublishTool/view.jsx @@ -8,7 +8,7 @@ import { SAVE } from '../../constants/confirmation_messages'; class PublishTool extends React.Component { render () { - const {disabled, file, isUpdate, status} = this.props; + const {disabled, file, isUpdate, uri, status} = this.props; if (disabled) { return ( @@ -25,7 +25,7 @@ class PublishTool extends React.Component { - + ); } diff --git a/client/src/utils/buildURI.js b/client/src/utils/buildURI.js new file mode 100644 index 00000000..b6fb599c --- /dev/null +++ b/client/src/utils/buildURI.js @@ -0,0 +1,10 @@ +export const buildURI = asset => { + let channelName, certificateId, name, claimId; + if (asset.claimData) { + ({ channelName, certificateId, name, claimId } = asset.claimData); + } + if (channelName) { + return `${channelName}:${certificateId}/${name}`; + } + return `${claimId}/${name}`; +};