update rawName and channel on edit claim

This commit is contained in:
btzr-io 2017-08-25 21:32:21 -06:00 committed by Jeremy Kauffman
parent b8cadad26b
commit 2a09110d53
2 changed files with 8 additions and 3 deletions

View file

@ -81,6 +81,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")
@ -189,7 +192,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

@ -418,12 +418,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() {