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

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

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