Skip to content

Commit

Permalink
fix(kyc-reset): dont show doc submission banner if user kyc is pending
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Jul 15, 2021
1 parent a58a216 commit 2f874f7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ export const getData = (state: RootState): { bannerToShow: BannerType } => {
const isKycStateNone =
// @ts-ignore
selectors.modules.profile.getUserKYCState(state).getOrElse('') === 'NONE'

const isFirstLogin = selectors.auth.getFirstLogin(state)

const userDataR = selectors.modules.profile.getUserData(state)
const userData = userDataR.getOrElse({
tiers: { current: 0 }
} as UserDataType)

const isKycStatePending = userData.kycState === 'PENDING' || userData.kycState === 'UNDER_REVIEW'
const sddEligibleTier = selectors.components.simpleBuy.getUserSddEligibleTier(state).getOrElse(1)

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

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

0 comments on commit 2f874f7

Please sign in to comment.