Skip to content

Commit

Permalink
fix(kyc): hotfix for kyc reset
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Aug 3, 2021
1 parent ba8e0da commit b4cea6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Expand Up @@ -36,7 +36,7 @@ export const wrongFlowTypeError = 'Wrong flow type'
export const noCampaignDataError = 'User did not come from campaign'

export default ({ api, coreSagas, networks }) => {
const { TIERS } = model.profile
const { KYC_STATES, TIERS } = model.profile
const {
createUser,
fetchUser,
Expand Down Expand Up @@ -146,7 +146,7 @@ export default ({ api, coreSagas, networks }) => {
)).getOrElse({})
const tiersState = (yield select(selectors.modules.profile.getTiers)).getOrElse({})
if (kycDocResubmissionStatus === 1) {
if (tiers.current === 0) {
if (tiers.current === 0 || kycState === KYC_STATES.NONE) {
// case where user already went through first step
// of verfication but was rejected, want to set
// next to 2
Expand Down Expand Up @@ -479,16 +479,16 @@ export default ({ api, coreSagas, networks }) => {
goToPrevStep,
initializeStep,
initializeVerification,
resendSmsCode,
registerUserCampaign,
resendSmsCode,
saveInfoAndResidentialData,
selectTier,
sendDeeplink,
sendEmailVerification,
updateSmsStep,
updateEmail,
updateSmsNumber,
updateSmsStep,
verifyIdentity,
verifySmsNumber,
updateEmail
verifySmsNumber
}
}
Expand Up @@ -44,8 +44,10 @@ export const getData = (state: RootState): { bannerToShow: BannerType } => {
} as UserDataType)

const { KYC_STATES } = model.profile
const isKycStatePending =
userData.kycState === KYC_STATES.PENDING || userData.kycState === KYC_STATES.UNDER_REVIEW
const isKycPendingOrVerified =
userData.kycState === KYC_STATES.PENDING ||
userData.kycState === KYC_STATES.UNDER_REVIEW ||
userData.kycState === KYC_STATES.VERIFIED
const sddEligibleTier = selectors.components.simpleBuy.getUserSddEligibleTier(state).getOrElse(1)

const limits = selectors.components.simpleBuy.getLimits(state).getOrElse({
Expand All @@ -61,7 +63,7 @@ export const getData = (state: RootState): { bannerToShow: BannerType } => {
const isTier3SDD = sddEligibleTier === 3

let bannerToShow: BannerType = null
if (showDocResubmitBanner && !isKycStatePending) {
if (showDocResubmitBanner && !isKycPendingOrVerified) {
bannerToShow = 'resubmit'
} else if (isSimpleBuyOrderPending && !isTier3SDD) {
bannerToShow = 'sbOrder'
Expand Down

0 comments on commit b4cea6d

Please sign in to comment.