Merge pull request #1524 from mewtaylor/hotfix/fix-interval

[Master] fix parentheses around interval
This commit is contained in:
Matthew Taylor 2017-09-09 17:15:33 -04:00 committed by GitHub
commit e2eb7eb788

View file

@ -43,9 +43,9 @@ var Navigation = React.createClass({
},
componentDidMount: function () {
if (this.props.session.session.user) {
var intervalId = setInterval(
this.props.dispatch(messageCountActions.getCount(this.props.session.session.user.username), 120000)
); // check for new messages every 2 mins.
var intervalId = setInterval(function () {
this.props.dispatch(messageCountActions.getCount(this.props.session.session.user.username));
}.bind(this), 120000); // check for new messages every 2 mins.
this.setState({'messageCountIntervalId': intervalId});
}
},
@ -56,9 +56,9 @@ var Navigation = React.createClass({
'accountNavOpen': false
});
if (this.props.session.session.user) {
var intervalId = setInterval(
this.props.dispatch(messageCountActions.getCount(this.props.session.session.user.username), 120000)
); // check for new messages every 2 mins.
var intervalId = setInterval(function () {
this.props.dispatch(messageCountActions.getCount(this.props.session.session.user.username));
}.bind(this), 120000); // check for new messages every 2 mins.
this.setState({'messageCountIntervalId': intervalId});
} else {
// clear message count check, and set to default id.