Skip to content

Commit 35d650e

Browse files
fix refresh error (Uniswap#429)
1 parent d18ee78 commit 35d650e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/contexts/Application.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,11 @@ export function Updater() {
7474
const [, { updateBlockNumber, updateUSDPrice }] = useApplicationContext()
7575

7676
// slow down polling interval
77-
useEffect(() => {
78-
if (library) {
79-
if (connectorName === 'Network') {
80-
library.polling = false
81-
} else {
82-
library.pollingInterval = 5
83-
}
84-
}
85-
}, [library, connectorName])
77+
if (library && connectorName === 'Network' && library.polling !== false) {
78+
library.polling = false
79+
} else if (library && library.pollingInterval !== 5) {
80+
library.pollingInterval = 5
81+
}
8682

8783
// update usd price
8884
useEffect(() => {

0 commit comments

Comments
 (0)