simple fix for #467
This commit is contained in:
parent
16f14fd382
commit
fa531e9497
2 changed files with 7 additions and 4 deletions
|
@ -77,6 +77,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,
|
||||||
|
@ -180,7 +181,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
|
||||||
|
|
|
@ -46,6 +46,7 @@ class PublishForm extends React.PureComponent {
|
||||||
modal: null,
|
modal: null,
|
||||||
isFee: false,
|
isFee: false,
|
||||||
customUrl: false,
|
customUrl: false,
|
||||||
|
path: "",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,13 +409,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 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,6 +526,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);
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue