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

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

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