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

Commit

Permalink
fix(wallet): fetch info before page reload
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Oct 10, 2020
1 parent 164a20e commit 8c1ef50
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions renderer/reducers/activity/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,19 +256,17 @@ export const resetPaginator = () => () => {
* @returns {(dispatch:Function, getState:Function) => Promise<void>} Thunk
*/
export const loadPage = (reload = false) => async (dispatch, getState) => {
const state = getState()

if (isPageLoading(state)) {
if (isPageLoading(getState())) {
return
}
dispatch(setPageLoading(true))

await dispatch(fetchInfo())
const config = settingsSelectors.currentConfig(state)
const blockHeight = infoSelectors.blockHeight(state)
const config = settingsSelectors.currentConfig(getState())
const blockHeight = infoSelectors.blockHeight(getState())
const thisPaginator = getPaginator()

if (reload || hasNextPage(state)) {
if (reload || hasNextPage(getState())) {
const { pageSize } = config.activity
const { items, hasNextPage: paginatorHasNextPage } = await thisPaginator(pageSize, blockHeight)

Expand Down

0 comments on commit 8c1ef50

Please sign in to comment.