diff --git a/src/routes/safe/container/index.jsx b/src/routes/safe/container/index.jsx index 4b60b103..e4575fac 100644 --- a/src/routes/safe/container/index.jsx +++ b/src/routes/safe/container/index.jsx @@ -6,15 +6,25 @@ import Layout from '~/routes/safe/component/Layout' import selector, { type SelectorProps } from './selector' import actions, { type Actions } from './actions' -class SafeView extends React.PureComponent { - componentDidMount() { - const { safe, fetchBalance } = this.props - if (!safe) { return } +type Props = Actions & SelectorProps - const safeAddress: string = safe.get('address') - fetchBalance(safeAddress) +class SafeView extends React.PureComponent { + 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() { const { safe, provider, balance } = this.props