Skip to content

Commit

Permalink
feat(Borrow): waitForUserData before fetching loans
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip London committed Feb 5, 2020
1 parent 7fb1976 commit e2fbfe2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as components from './components/actionTypes'
import * as goals from './goals/actionTypes'
import * as logs from './logs/actionTypes'
import * as middleware from './middleware/actionTypes'
import * as modals from './modals/actionTypes.ts'
import * as modals from './modals/actionTypes'
import * as modules from './modules/actionTypes'
import * as preferences from './preferences/actionTypes'
import * as session from './session/actionTypes'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as coinify from './coinify/actionTypes'
import * as ethTransactions from './ethTransactions/actionTypes'
import * as exchange from './exchange/actionTypes'
import * as exchangeHistory from './exchangeHistory/actionTypes'
import * as identityVerification from './identityVerification/actionTypes.ts'
import * as identityVerification from './identityVerification/actionTypes'
import * as importBtcAddress from './importBtcAddress/actionTypes'
import * as layoutWallet from './layoutWallet/actionTypes'
import * as lockbox from './lockbox/actionTypes'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { actions, selectors } from 'data'
import { ADDRESS_TYPES } from 'blockchain-wallet-v4/src/redux/payment/btc/utils'
import { APIType } from 'blockchain-wallet-v4/src/network/api'
import { BorrowFormValuesType, PaymentType } from './types'
import { call, put, select } from 'redux-saga/effects'
import { call, put, select, take } from 'redux-saga/effects'
import { Exchange } from 'blockchain-wallet-v4/src'
import { FormAction, initialize } from 'redux-form'
import { LoanType } from 'core/types'
import { NO_OFFER_EXISTS } from './model'
import { nth } from 'ramda'
import { promptForSecondPassword } from 'services/SagaService'
import BigNumber from 'bignumber.js'
import profileSagas from '../../../data/modules/profile/sagas'

export default ({
api,
Expand All @@ -22,6 +23,9 @@ export default ({
coreSagas: any
networks: any
}) => {
const waitForUserData = profileSagas({ api, coreSagas, networks })
.waitForUserData

const createBorrow = function * () {
try {
yield put(actions.form.startSubmit('borrowForm'))
Expand Down Expand Up @@ -163,6 +167,7 @@ export default ({
const fetchUserBorrowHistory = function * () {
try {
yield put(A.fetchUserBorrowHistoryLoading())
yield call(waitForUserData)
const offers = yield call(api.getUserBorrowHistory)
yield put(A.fetchUserBorrowHistorySuccess(offers))
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as addressesBch from './addressesBch/actionTypes'
import * as profile from './profile/actionTypes.ts'
import * as profile from './profile/actionTypes'
import * as rates from './rates/actionTypes'
import * as securityCenter from './securityCenter/actionTypes'
import * as settings from './settings/actionTypes'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ export default ({ api, coreSagas, networks }) => {
signIn,
syncUserWithWallet,
updateUser,
updateUserAddress
updateUserAddress,
waitForUserData
}
}

0 comments on commit e2fbfe2

Please sign in to comment.