update rawName and channel on edit claim

This commit is contained in:
btzr-io 2017-08-25 21:32:21 -06:00
parent c68b807638
commit 16f14fd382
2 changed files with 8 additions and 3 deletions

View file

@ -76,6 +76,9 @@ class FileActions extends React.PureComponent {
navigate,
} = this.props;
const name = fileInfo ? fileInfo.name : null;
const channel = fileInfo ? fileInfo.channel_name : null;
const metadata = fileInfo ? fileInfo.metadata : null,
openInFolderMessage = platform.startsWith("Mac")
? __("Open in Finder")
@ -177,7 +180,7 @@ class FileActions extends React.PureComponent {
{claimIsMine &&
<DropDownMenuItem
key={1}
onClick={() => navigate("/publish", { name: fileInfo.name })}
onClick={() => navigate("/publish", { name, channel })}
label={__("Edit claim")}
/>}
<DropDownMenuItem

View file

@ -408,12 +408,14 @@ class PublishForm extends React.PureComponent {
}
componentWillMount() {
const { name } = this.props.params;
const { name, channel } = this.props.params;
this.props.fetchClaimListMine();
this._updateChannelList();
if (name) this.setState({ name });
if (name && channel) {
this.setState({ name, rawName: name, channel });
}
}
componentDidMount() {