diff --git a/js/components/MainWindow/Marquee.js b/js/components/MainWindow/Marquee.js index eafcf134..eb763960 100644 --- a/js/components/MainWindow/Marquee.js +++ b/js/components/MainWindow/Marquee.js @@ -76,11 +76,12 @@ class Marquee extends React.Component { this.state = { stepping: true, dragOffset: 0 }; this.handleMouseDown = this.handleMouseDown.bind(this); this.getText = this.getText.bind(this); + this.stepHandle = null; } componentDidMount() { const step = () => { - setTimeout(() => { + this.stepHandle = setTimeout(() => { if (this.state.stepping) { this.props.dispatch({ type: STEP_MARQUEE }); } @@ -92,6 +93,12 @@ class Marquee extends React.Component { } } + componentWillUnmount() { + if (this.stepHandle) { + clearTimeout(this.stepHandle); + } + } + getText() { switch (this.props.userInput.focus) { case "balance":