Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ import { useRemote } from 'hooks'
import { isNabuError } from 'services/errors'

import Loading from '../template.loading'
import { UpdateSecurityCodeComponent } from './types'

const UpdateSecurityCode: UpdateSecurityCodeComponent = ({ backToEnterAmount }) => {
const UpdateSecurityCode = ({ backToEnterAmount }: { backToEnterAmount: () => void }) => {
const dispatch = useDispatch()
const [cvv, setCvv] = useState<string | null>(null)
const { data: order } = useRemote(selectors.components.buySell.getBSOrder)
Expand All @@ -52,10 +51,6 @@ const UpdateSecurityCode: UpdateSecurityCodeComponent = ({ backToEnterAmount })
}
}

const errorCallback = () => {
backToEnterAmount()
}

useEffect(() => {
return () => {
dispatch(actions.components.buySell.cvvStatusReset())
Expand All @@ -64,14 +59,14 @@ const UpdateSecurityCode: UpdateSecurityCodeComponent = ({ backToEnterAmount })

if (error) {
if (isNabuError(error)) {
return <GenericNabuErrorFlyout error={error} onDismiss={errorCallback} />
return <GenericNabuErrorFlyout error={error} onDismiss={backToEnterAmount} />
}

return (
<FlyoutOopsError
action='retry'
data-e2e='sbUpdateSecurityCodeSectionAgain'
handler={errorCallback}
handler={backToEnterAmount}
/>
)
}
Expand Down Expand Up @@ -146,9 +141,7 @@ const UpdateSecurityCode: UpdateSecurityCodeComponent = ({ backToEnterAmount })
<FormattedMessage
id='modals.simplebuy.card_ending_in'
defaultMessage='Card Ending in {lastFour}'
values={{
lastFour: method.card?.number
}}
values={{ lastFour: method.card?.number }}
/>
}
/>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,7 @@ class BuySell extends PureComponent<Props, State> {
)}
{this.props.step === 'UPDATE_SECURITY_CODE' && (
<FlyoutChild>
<UpdateSecurityCode
backToEnterAmount={this.backToEnterAmount}
handleClose={this.handleClose}
/>
<UpdateSecurityCode backToEnterAmount={this.backToEnterAmount} />
</FlyoutChild>
)}
{this.props.step === 'CRYPTO_SELECTION' && (
Expand Down