fix channel selector issues on publish page #43

Merged
akinwale merged 3 commits from publish-channel-selector into master 2019-09-15 13:02:34 +02:00
Showing only changes of commit 1678731601 - Show all commits

View file

@ -30,11 +30,14 @@ export default class ChannelSelector extends React.PureComponent {
if (!channels.length && !fetchingChannels) {
fetchChannelListMine();
}
this.setState({ currentSelectedValue: channelName });
}
componentDidUpdate() {
const { channelName } = this.props;
if (this.state.currentSelectedValue !== channelName) {
componentWillReceiveProps(nextProps) {
const { channels: prevChannels = [], channelName } = this.props;
const { channels = [] } = nextProps;
if (channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) {
this.setState({ currentSelectedValue: channelName });
}
}