diff --git a/src/CardUtils.res b/src/CardUtils.res index c060d5ee..bcb9c8ea 100644 --- a/src/CardUtils.res +++ b/src/CardUtils.res @@ -672,16 +672,10 @@ let getEligibleCoBadgedCardSchemes = (~matchedCardSchemes, ~enabledCardSchemes) }) } -let getCardBrandFromStates = ( - sdkScreenType, - cardBrand, - cardScheme, - showFields, - isNotBancontact, -) => { - switch (sdkScreenType, showFields, isNotBancontact) { - | (RecoilAtomTypes.SAVEDCARD, _, _) => cardScheme - | (_, false, true) => cardScheme +let getCardBrandFromStates = (cardBrand, cardScheme, showFields, isNotBancontact) => { + switch (showFields, isNotBancontact) { + | (false, _) => cardScheme + | (_, true) => cardBrand | _ => cardBrand } } diff --git a/src/Components/SavedMethods.res b/src/Components/SavedMethods.res index dcdf6ed7..ae2dbdf1 100644 --- a/src/Components/SavedMethods.res +++ b/src/Components/SavedMethods.res @@ -46,13 +46,6 @@ let make = ( let {paymentToken: paymentTokenVal, customerId} = paymentToken - let setSdKScreenType = Recoil.useSetRecoilState(RecoilAtoms.sdkScreenType) - - React.useEffect1(() => { - setSdKScreenType(_ => RecoilAtomTypes.SAVEDCARD) - None - }, []) - let bottomElement = {
{savedMethods diff --git a/src/Payment.res b/src/Payment.res index b2fc48ab..6b159e8b 100644 --- a/src/Payment.res +++ b/src/Payment.res @@ -18,8 +18,6 @@ let make = (~paymentMode, ~integrateError, ~logger) => { let isManualRetryEnabled = Recoil.useRecoilValueFromAtom(isManualRetryEnabled) let paymentToken = Recoil.useRecoilValueFromAtom(paymentTokenAtom) let paymentMethodListValue = Recoil.useRecoilValueFromAtom(PaymentUtils.paymentMethodListValue) - let sdkScreenType = Recoil.useRecoilValueFromAtom(RecoilAtoms.sdkScreenType) - let {iframeId} = keys let (cardNumber, setCardNumber) = React.useState(_ => "") @@ -57,8 +55,8 @@ let make = (~paymentMode, ~integrateError, ~logger) => { let (cardBrand, setCardBrand) = React.useState(_ => !showFields && isNotBancontact ? cardScheme : cardBrand ) + let cardBrand = CardUtils.getCardBrandFromStates( - sdkScreenType, cardBrand, cardScheme, showFields, diff --git a/src/Payments/CardPayment.res b/src/Payments/CardPayment.res index 8c14931d..27d76278 100644 --- a/src/Payments/CardPayment.res +++ b/src/Payments/CardPayment.res @@ -22,11 +22,6 @@ let make = ( let paymentMethodListValue = Recoil.useRecoilValueFromAtom(PaymentUtils.paymentMethodListValue) let (nickname, setNickname) = React.useState(_ => "") - let setSdKScreenType = Recoil.useSetRecoilState(RecoilAtoms.sdkScreenType) - React.useEffect1(() => { - setSdKScreenType(_ => RecoilAtomTypes.CARDFORM) - None - }, []) let ( isCardValid, diff --git a/src/Types/RecoilAtomTypes.res b/src/Types/RecoilAtomTypes.res index 4990b2dd..879de0bd 100644 --- a/src/Types/RecoilAtomTypes.res +++ b/src/Types/RecoilAtomTypes.res @@ -6,8 +6,6 @@ type field = { } type load = Loading | Loaded(JSON.t) | LoadError -type screenType = CARDFORM | SAVEDCARD | NONE -let defaultScreenValues = NONE type paymentToken = { paymentToken: string, diff --git a/src/Utilities/RecoilAtoms.res b/src/Utilities/RecoilAtoms.res index 536462de..d1207655 100644 --- a/src/Utilities/RecoilAtoms.res +++ b/src/Utilities/RecoilAtoms.res @@ -75,7 +75,6 @@ let userPixCPF = Recoil.atom("userPixCPF", defaultFieldValues) let userPixCNPJ = Recoil.atom("userPixCNPJ", defaultFieldValues) let isCompleteCallbackUsed = Recoil.atom("isCompleteCallbackUsed", false) let isPaymentButtonHandlerProvidedAtom = Recoil.atom("isPaymentButtonHandlerProvidedAtom", false) -let sdkScreenType = Recoil.atom("sdkScreenType", defaultScreenValues) type areOneClickWalletsRendered = { isGooglePay: bool,