Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
perf(wallet): loading activity data in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Oct 13, 2020
1 parent 3f4798f commit 217e3f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions renderer/reducers/activity/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,7 @@ export const reloadPages = () => async dispatch => {
export const initActivityHistory = () => async dispatch => {
dispatch({ type: FETCH_ACTIVITY_HISTORY })
try {
dispatch(fetchChannels())
dispatch(fetchBalance())
await dispatch(loadPage())
await Promise.all([dispatch(loadPage()), dispatch(fetchChannels()), dispatch(fetchBalance())])
dispatch({ type: FETCH_ACTIVITY_HISTORY_SUCCESS })
} catch (error) {
dispatch({ type: FETCH_ACTIVITY_HISTORY_FAILURE, error })
Expand All @@ -322,9 +320,11 @@ export const initActivityHistory = () => async dispatch => {
export const reloadActivityHistory = () => async dispatch => {
dispatch({ type: FETCH_ACTIVITY_HISTORY })
try {
await dispatch(reloadPages())
dispatch(fetchChannels())
dispatch(fetchBalance())
await Promise.all([
dispatch(reloadPages()),
dispatch(fetchChannels()),
dispatch(fetchBalance()),
])
dispatch({ type: FETCH_ACTIVITY_HISTORY_SUCCESS })
} catch (error) {
dispatch({ type: FETCH_ACTIVITY_HISTORY_FAILURE, error })
Expand Down

0 comments on commit 217e3f0

Please sign in to comment.