refactor: fetch safe and tokens simultaneously

This commit is contained in:
fernandomg 2020-05-27 10:13:28 -03:00
parent 823fc40f7d
commit e08083743d
1 changed files with 4 additions and 2 deletions

View File

@ -15,8 +15,10 @@ export const useLoadSafe = (safeAddress) => {
const fetchData = () => { const fetchData = () => {
if (safeAddress) { if (safeAddress) {
dispatch(fetchLatestMasterContractVersion()) dispatch(fetchLatestMasterContractVersion())
.then(() => dispatch(fetchSafe(safeAddress))) .then(() => {
.then(() => dispatch(fetchSafeTokens(safeAddress))) dispatch(fetchSafe(safeAddress))
return dispatch(fetchSafeTokens(safeAddress))
})
.then(() => { .then(() => {
dispatch(loadAddressBookFromStorage()) dispatch(loadAddressBookFromStorage())
dispatch(fetchTransactions(safeAddress)) dispatch(fetchTransactions(safeAddress))