From 91cd4d1dd33bb08ab3ce37de94a8e3f3c60bb12c Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sat, 14 Apr 2018 12:31:29 -0700 Subject: [PATCH] Use setInterval --- js/components/MainWindow/Marquee.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/js/components/MainWindow/Marquee.js b/js/components/MainWindow/Marquee.js index 8f176b43..a8a4e0f3 100644 --- a/js/components/MainWindow/Marquee.js +++ b/js/components/MainWindow/Marquee.js @@ -76,15 +76,11 @@ class Marquee extends React.Component { } componentDidMount() { - const step = () => { - this.stepHandle = setTimeout(() => { - if (this.state.stepping) { - this.props.dispatch({ type: STEP_MARQUEE }); - } - step(); - }, 220); - }; - step(); + this.stepHandle = setInterval(() => { + if (this.state.stepping) { + this.props.dispatch({ type: STEP_MARQUEE }); + } + }, 220); } componentWillUnmount() {