mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-10 16:46:35 +00:00
WA-230 Introducing interval for checking balance every 1.5 second
This commit is contained in:
parent
86d3c7c9c4
commit
8455485849
@ -6,15 +6,25 @@ import Layout from '~/routes/safe/component/Layout'
|
|||||||
import selector, { type SelectorProps } from './selector'
|
import selector, { type SelectorProps } from './selector'
|
||||||
import actions, { type Actions } from './actions'
|
import actions, { type Actions } from './actions'
|
||||||
|
|
||||||
class SafeView extends React.PureComponent<Actions & SelectorProps> {
|
type Props = Actions & SelectorProps
|
||||||
componentDidMount() {
|
|
||||||
const { safe, fetchBalance } = this.props
|
|
||||||
if (!safe) { return }
|
|
||||||
|
|
||||||
const safeAddress: string = safe.get('address')
|
class SafeView extends React.PureComponent<Props> {
|
||||||
fetchBalance(safeAddress)
|
componentDidMount() {
|
||||||
|
this.intervalId = setInterval(() => {
|
||||||
|
const { safe, fetchBalance } = this.props
|
||||||
|
if (!safe) { return }
|
||||||
|
|
||||||
|
const safeAddress: string = safe.get('address')
|
||||||
|
fetchBalance(safeAddress)
|
||||||
|
}, 1500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
clearInterval(this.intervalId)
|
||||||
|
}
|
||||||
|
|
||||||
|
intervalId: IntervalID
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { safe, provider, balance } = this.props
|
const { safe, provider, balance } = this.props
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user