Этот коммит содержится в:
JoramWilander
2015-12-01 11:59:35 -05:00
родитель 62c96514bf
Коммит 362b9f2f94

Просмотреть файл

@@ -32,11 +32,13 @@ export default class ChannelNotificationsModal extends React.Component {
activeSection: '' activeSection: ''
}; };
} }
componentDidMount() { componentWillReceiveProps(nextProps) {
ChannelStore.addChangeListener(this.onListenerChange); if (nextProps.show) {
} this.onListenerChange();
componentWillUnmount() { ChannelStore.addChangeListener(this.onListenerChange);
ChannelStore.removeChangeListener(this.onListenerChange); } else {
ChannelStore.removeChangeListener(this.onListenerChange);
}
} }
onListenerChange() { onListenerChange() {
const curChannelId = ChannelStore.getCurrentId(); const curChannelId = ChannelStore.getCurrentId();