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 = () => {
if (safeAddress) {
dispatch(fetchLatestMasterContractVersion())
.then(() => dispatch(fetchSafe(safeAddress)))
.then(() => dispatch(fetchSafeTokens(safeAddress)))
.then(() => {
dispatch(fetchSafe(safeAddress))
return dispatch(fetchSafeTokens(safeAddress))
})
.then(() => {
dispatch(loadAddressBookFromStorage())
dispatch(fetchTransactions(safeAddress))