Skip to content

Commit

Permalink
fix(Coinify): increase limit will continue kyc if unfinished
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed Jun 4, 2018
1 parent a7ffbb1 commit d888cf7
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,15 @@ export default ({ coreSagas }) => {
}

const openKYC = function * (data) {
const kyc = data.payload
let kyc = data.payload
const inProgressKycs = yield select(selectors.core.data.coinify.getSortedKycs)
const recentKyc = head(inProgressKycs.data)

try {
if (!data.payload) {
if (!data.payload && !equals(prop('state', recentKyc), 'pending')) {
yield call(triggerKYC)
} else if (kyc.state === 'pending') {
yield call(coreSagas.data.coinify.kycAsTrade, { kyc })
} else if (equals(prop('state', kyc), 'pending') || equals(prop('state', recentKyc), 'pending')) {
yield call(coreSagas.data.coinify.kycAsTrade, { kyc: kyc || recentKyc }) // if no kyc was given, take the most recent
yield put(A.coinifyNextCheckoutStep('isx'))
} else {
yield call(triggerKYC)
Expand Down

0 comments on commit d888cf7

Please sign in to comment.