From 35d650e02b960a21643859ca8fe464435b8ffa72 Mon Sep 17 00:00:00 2001 From: Noah Zinsmeister Date: Tue, 27 Aug 2019 01:02:25 +0200 Subject: [PATCH] fix refresh error (#429) --- src/contexts/Application.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/contexts/Application.js b/src/contexts/Application.js index db52063f25..162aef09c7 100644 --- a/src/contexts/Application.js +++ b/src/contexts/Application.js @@ -74,15 +74,11 @@ export function Updater() { const [, { updateBlockNumber, updateUSDPrice }] = useApplicationContext() // slow down polling interval - useEffect(() => { - if (library) { - if (connectorName === 'Network') { - library.polling = false - } else { - library.pollingInterval = 5 - } - } - }, [library, connectorName]) + if (library && connectorName === 'Network' && library.polling !== false) { + library.polling = false + } else if (library && library.pollingInterval !== 5) { + library.pollingInterval = 5 + } // update usd price useEffect(() => {