From 0497567f2fd85ab1551097a0f78c56302528aa4f Mon Sep 17 00:00:00 2001 From: petitPapillon Date: Thu, 20 Jul 2017 22:13:53 +0200 Subject: [PATCH] Fix a 'GET_ACTIVE_COINS' duplicate call --- react/src/components/login/login.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/react/src/components/login/login.js b/react/src/components/login/login.js index 44dae9e..47f8b0b 100644 --- a/react/src/components/login/login.js +++ b/react/src/components/login/login.js @@ -53,6 +53,9 @@ class Login extends React.Component { this.resizeLoginTextarea = this.resizeLoginTextarea.bind(this); } + // the setInterval handler for 'activeCoins' + _iguanaActiveCoins = null; + isCustomWalletSeed() { return this.state.customWalletSeed; } @@ -131,10 +134,13 @@ class Login extends React.Component { }); if (!this.props.Interval.interval.activeCoins) { - const _iguanaActiveCoins = setInterval(() => { - Store.dispatch(getDexCoins()); - }, IGUNA_ACTIVE_COINS_TIMEOUT); - Store.dispatch(startInterval('activeCoins', _iguanaActiveCoins)); + // only start a new 'activeCoins' interval if a previous one doesn't exist + if (!this._iguanaActiveCoins) { + this._iguanaActiveCoins = setInterval(() => { + Store.dispatch(getDexCoins()); + }, IGUNA_ACTIVE_COINS_TIMEOUT); + Store.dispatch(startInterval('activeCoins', this._iguanaActiveCoins)); + } } document.body.className = 'page-login layout-full page-dark';