Commit 7d470131 authored by picklesrus's avatar picklesrus

Add check for existence of messageTimeoutId before clearing the timeout.

parent 25b9bacd
...@@ -47,8 +47,10 @@ class Navigation extends React.Component { ...@@ -47,8 +47,10 @@ class Navigation extends React.Component {
const twoMinInMs = 2 * 60 * 1000; const twoMinInMs = 2 * 60 * 1000;
this.messageCountTimeoutId = setTimeout(this.pollForMessages.bind(this, twoMinInMs), twoMinInMs); this.messageCountTimeoutId = setTimeout(this.pollForMessages.bind(this, twoMinInMs), twoMinInMs);
} else { } else {
// clear message count check, and set to default id. // Clear message count check, and set to default id.
if (this.messageCountTimeoutId !== -1) {
clearTimeout(this.messageCountTimeoutId); clearTimeout(this.messageCountTimeoutId);
}
this.props.setMessageCount(0); this.props.setMessageCount(0);
this.messageCountTimeoutId = -1; this.messageCountTimeoutId = -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment