mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-26 00:15:23 +00:00
WA-521 fetchTransactions in safe's view in a loop
This commit is contained in:
parent
fb0f9160c6
commit
0f563a2b56
@ -1,13 +1,16 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import fetchSafe from '~/routes/safe/store/actions/fetchSafe'
|
import fetchSafe from '~/routes/safe/store/actions/fetchSafe'
|
||||||
|
import fetchTransactions from '~/routes/safe/store/actions/fetchTransactions'
|
||||||
import { fetchTokens } from '~/routes/tokens/store/actions/fetchTokens'
|
import { fetchTokens } from '~/routes/tokens/store/actions/fetchTokens'
|
||||||
|
|
||||||
export type Actions = {
|
export type Actions = {
|
||||||
fetchSafe: typeof fetchSafe,
|
fetchSafe: typeof fetchSafe,
|
||||||
fetchTokens: typeof fetchTokens,
|
fetchTokens: typeof fetchTokens,
|
||||||
|
fetchTransactions: typeof fetchTransactions,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
fetchSafe,
|
fetchSafe,
|
||||||
fetchTokens,
|
fetchTokens,
|
||||||
|
fetchTransactions,
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,13 @@ class SafeView extends React.PureComponent<Props> {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.intervalId = setInterval(() => {
|
this.intervalId = setInterval(() => {
|
||||||
const {
|
const {
|
||||||
safe, fetchTokens, fetchSafe,
|
safe, fetchTokens, fetchSafe, fetchTransactions,
|
||||||
} = this.props
|
} = this.props
|
||||||
if (!safe) {
|
if (!safe) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const safeAddress = safe.get('address')
|
const safeAddress = safe.get('address')
|
||||||
|
fetchTransactions(safeAddress)
|
||||||
fetchTokens(safeAddress)
|
fetchTokens(safeAddress)
|
||||||
fetchSafe(safe)
|
fetchSafe(safe)
|
||||||
}, TIMEOUT)
|
}, TIMEOUT)
|
||||||
@ -36,6 +37,7 @@ class SafeView extends React.PureComponent<Props> {
|
|||||||
if (this.props.safe) {
|
if (this.props.safe) {
|
||||||
const safeAddress = this.props.safe.get('address')
|
const safeAddress = this.props.safe.get('address')
|
||||||
this.props.fetchTokens(safeAddress)
|
this.props.fetchTokens(safeAddress)
|
||||||
|
this.props.fetchTransactions(safeAddress)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user