fix channel selector issues on publish page
This commit is contained in:
parent
34fa24ffd0
commit
1678731601
1 changed files with 6 additions and 3 deletions
|
@ -30,11 +30,14 @@ export default class ChannelSelector extends React.PureComponent {
|
||||||
if (!channels.length && !fetchingChannels) {
|
if (!channels.length && !fetchingChannels) {
|
||||||
fetchChannelListMine();
|
fetchChannelListMine();
|
||||||
}
|
}
|
||||||
|
this.setState({ currentSelectedValue: channelName });
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { channelName } = this.props;
|
const { channels: prevChannels = [], channelName } = this.props;
|
||||||
if (this.state.currentSelectedValue !== channelName) {
|
const { channels = [] } = nextProps;
|
||||||
|
|
||||||
|
if (channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) {
|
||||||
this.setState({ currentSelectedValue: channelName });
|
this.setState({ currentSelectedValue: channelName });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue