Skip to content

Commit

Permalink
fix(Jumio): don't show jumio status if process has not started
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Aug 9, 2018
1 parent 36d8d03 commit ed9aab7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export default ({ coreSagas }) => {
const accountsR = yield select(selectors.core.data.sfox.getAccounts)
const accounts = accountsR.getOrElse([])
// If user has not set up jumio and they have bank accounts
if (status === missingJumioToken && accounts.length) {
if (!status && accounts.length) {
const confirmed = yield call(confirm, {
title: CC.VERIFY_IDENTITY_TITLE,
image: 'identity-verification',
Expand Down Expand Up @@ -345,9 +345,14 @@ export default ({ coreSagas }) => {
const tokenR = yield select(selectors.core.kvStore.buySell.getSfoxJumio)
const token = tokenR.getOrFail()
const profile = profileR.getOrElse({})
if (!token) return missingJumioToken
const status = yield apply(profile, profile.fetchJumioStatus, [token.id])
yield put(A.fetchJumioStatusSuccess(status))
if (!token) {
throw new Error(missingJumioToken)
} else {
const status = yield apply(profile, profile.fetchJumioStatus, [
token.id
])
yield put(A.fetchJumioStatusSuccess(status))
}
} catch (e) {
yield put(A.fetchJumioStatusFailure(e))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { coreSagasFactory, Remote } from 'blockchain-wallet-v4/src'
import * as actions from '../../actions'
import * as sfoxActions from './actions.js'
import * as selectors from '../../selectors.js'
import sfoxSagas, { logLocation, missingJumioToken } from './sagas'
import sfoxSagas, { logLocation } from './sagas'
import * as C from 'services/AlertService'
import { promptForSecondPassword, confirm } from 'services/SagaService'
import settings from 'config'
Expand Down Expand Up @@ -595,7 +595,7 @@ describe('sfoxSagas', () => {
})

it('should select bank accounts', () => {
saga.next(missingJumioToken).select(selectors.core.data.sfox.getAccounts)
saga.next(undefined).select(selectors.core.data.sfox.getAccounts)
})

it('should prompt the user to confirm their id verification if missing_token and accounts', () => {
Expand Down

0 comments on commit ed9aab7

Please sign in to comment.