simple fix for #467

This commit is contained in:
btzr-io 2017-08-25 23:33:04 -06:00 committed by Jeremy Kauffman
parent 2a09110d53
commit 42cc8fdb52
2 changed files with 7 additions and 4 deletions

View file

@ -82,6 +82,7 @@ class FileActions extends React.PureComponent {
} = this.props; } = this.props;
const name = fileInfo ? fileInfo.name : null; const name = fileInfo ? fileInfo.name : null;
const path = fileInfo ? fileInfo.download_path : null;
const channel = fileInfo ? fileInfo.channel_name : null; const channel = fileInfo ? fileInfo.channel_name : null;
const metadata = fileInfo ? fileInfo.metadata : null, const metadata = fileInfo ? fileInfo.metadata : null,
@ -192,7 +193,7 @@ class FileActions extends React.PureComponent {
{claimIsMine && {claimIsMine &&
<DropDownMenuItem <DropDownMenuItem
key={1} key={1}
onClick={() => navigate("/publish", { name, channel })} onClick={() => navigate("/publish", { name, channel, path })}
label={__("Edit claim")} label={__("Edit claim")}
/>} />}
<DropDownMenuItem <DropDownMenuItem

View file

@ -48,6 +48,7 @@ class PublishForm extends React.PureComponent {
isFee: false, isFee: false,
customUrl: false, customUrl: false,
source: null, source: null,
path: "",
}; };
} }
@ -418,13 +419,13 @@ class PublishForm extends React.PureComponent {
} }
componentWillMount() { componentWillMount() {
const { name, channel } = this.props.params; const { name, channel, path } = this.props.params;
this.props.fetchClaimListMine(); this.props.fetchClaimListMine();
this._updateChannelList(); this._updateChannelList();
if (name && channel) { if (name && channel && path) {
this.setState({ name, rawName: name, channel }); this.setState({ name, rawName: name, channel, path });
} }
} }
@ -535,6 +536,7 @@ class PublishForm extends React.PureComponent {
label="File" label="File"
ref="file" ref="file"
type="file" type="file"
defaultValue={this.state.path}
onChange={event => { onChange={event => {
this.onFileChange(event); this.onFileChange(event);
}} }}