simple fix for #467

This commit is contained in:
btzr-io 2017-08-25 23:33:04 -06:00
parent 16f14fd382
commit fa531e9497
2 changed files with 7 additions and 4 deletions

View file

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

View file

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