clear publish and edit pages based on publish.isUpdate
This commit is contained in:
parent
5d3f66d201
commit
2778c42773
4 changed files with 17 additions and 20 deletions
|
@ -9,6 +9,7 @@ const mapStateToProps = (props) => {
|
||||||
return {
|
return {
|
||||||
asset : selectAsset(show),
|
asset : selectAsset(show),
|
||||||
myChannel: props.channel.loggedInChannel.name,
|
myChannel: props.channel.loggedInChannel.name,
|
||||||
|
isUpdate : props.publish.isUpdate,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,15 +5,15 @@ import PublishTool from '@containers/PublishTool';
|
||||||
|
|
||||||
class EditPage extends React.Component {
|
class EditPage extends React.Component {
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
const {asset, match, onHandleShowPageUri, setUpdateTrue, updateMetadata} = this.props;
|
const {asset, isUpdate, match, onHandleShowPageUri, clearFile, setUpdateTrue, updateMetadata} = this.props;
|
||||||
|
if (!isUpdate) {
|
||||||
|
clearFile();
|
||||||
onHandleShowPageUri(match.params);
|
onHandleShowPageUri(match.params);
|
||||||
setUpdateTrue();
|
setUpdateTrue();
|
||||||
if (asset) {
|
if (asset) {
|
||||||
['title', 'description', 'license', 'nsfw'].forEach(meta => updateMetadata(meta, asset.claimData[meta]));
|
['title', 'description', 'license', 'nsfw'].forEach(meta => updateMetadata(meta, asset.claimData[meta]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillUnmount () {
|
|
||||||
this.props.clearFile();
|
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
const { myChannel, asset } = this.props;
|
const { myChannel, asset } = this.props;
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { connect } from 'react-redux';
|
||||||
import { onHandleShowHomepage } from '../../actions/show';
|
import { onHandleShowHomepage } from '../../actions/show';
|
||||||
import View from './view';
|
import View from './view';
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
const mapStateToProps = ({ show, site, channel }) => {
|
const mapStateToProps = ({ show, site, channel }) => {
|
||||||
return {
|
return {
|
||||||
error : show.request.error,
|
error : show.request.error,
|
||||||
|
@ -9,6 +10,9 @@ const mapStateToProps = ({ show, site, channel }) => {
|
||||||
homeChannel: site.publishOnlyApproved && !channel.loggedInChannel.name ? `${site.approvedChannels[0].name}:${site.approvedChannels[0].longId}` : null,
|
homeChannel: site.publishOnlyApproved && !channel.loggedInChannel.name ? `${site.approvedChannels[0].name}:${site.approvedChannels[0].longId}` : null,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
=======
|
||||||
|
const mapStateToProps = props => ({ isUpdate: props.publish.isUpdate });
|
||||||
|
>>>>>>> clear publish and edit pages based on publish.isUpdate
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
const mapDispatchToProps = {
|
||||||
onHandleShowHomepage,
|
onHandleShowHomepage,
|
||||||
|
|
|
@ -4,19 +4,11 @@ import PublishTool from '@containers/PublishTool';
|
||||||
import ContentPageWrapper from '@pages/ContentPageWrapper';
|
import ContentPageWrapper from '@pages/ContentPageWrapper';
|
||||||
|
|
||||||
class HomePage extends React.Component {
|
class HomePage extends React.Component {
|
||||||
// componentDidMount () {
|
componentDidMount () {
|
||||||
// this.props.onHandleShowHomepage(this.props.match.params);
|
if (this.props.isUpdate) {
|
||||||
// }
|
|
||||||
//
|
|
||||||
// componentWillReceiveProps (nextProps) {
|
|
||||||
// if (nextProps.match.params !== this.props.match.params) {
|
|
||||||
// this.props.onHandleShowHomepage(nextProps.match.params);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
componentWillUnmount () {
|
|
||||||
this.props.clearFile();
|
this.props.clearFile();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
render () {
|
render () {
|
||||||
const { homeChannel } = this.props;
|
const { homeChannel } = this.props;
|
||||||
return homeChannel ? (
|
return homeChannel ? (
|
||||||
|
|
Loading…
Reference in a new issue