Skip to content

Commit

Permalink
Release/v4.98.8 (#6323)
Browse files Browse the repository at this point in the history
* fix(balances): show balances when they are 0 (#6306)

* chore(form): use error returned form BE if available (#6313)

* chore(Release): v4.98.8
  • Loading branch information
mperdomo-bc committed Mar 5, 2024
1 parent 1a21f33 commit 83a9715
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockchain-wallet-v4",
"version": "4.98.7",
"version": "4.98.8",
"license": "AGPL-3.0-or-later",
"private": true,
"author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@
"modals.mobilenumberchange.mobile": "Mobile number:",
"modals.mobilenumberchange.update": "Update",
"modals.mobilenumberverify.change": "change mobile number",
"modals.mobilenumberverify.explain": "We have sent an SMS message with a verification code to {number}.",
"modals.mobilenumberverify.explain": "We have sent an SMS message with a verification code to {mobileNumber}.",
"modals.mobilenumberverify.explain2": "Enter code:",
"modals.mobilenumberverify.getcode1": "Didn't get the code?",
"modals.mobilenumberverify.getcode2": "or",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const Balance = ({ coin, coinTicker }: Props) => {
const { data, hasError, isLoading, isNotAsked } = useRemote(
selectors.balances.getCoinTotalBalance(coin)
)

const handleRefresh = () => {
if (window.coins?.[coin]?.coinfig?.type.erc20Address) {
dispatch(fetchErc20Data(coin))
Expand All @@ -23,7 +24,7 @@ const Balance = ({ coin, coinTicker }: Props) => {
}
}

if (isLoading || isNotAsked || !data) {
if (isLoading || isNotAsked || typeof data !== 'number') {
return <LoadingBalance coinTicker={coinTicker} />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,13 @@ import { LinkContainer } from 'react-router-bootstrap'
import styled from 'styled-components'

import { SkeletonRectangle, Text } from 'blockchain-info-components'
import CoinDisplay from 'components/Display/CoinDisplay'
import FiatDisplay from 'components/Display/FiatDisplay'
import SwitchableDisplay from 'components/Display/SwitchableDisplay'

const CoinBalanceMain = styled.div`
display: inline-flex;
flex-direction: row;
align-items: center;
padding-right: 15px;
> div:last-child {
margin-left: 10px;
> div {
color: ${(props) => props.theme.blue900};
}
}
`
const CoinBalanceSwitchable = styled.div`
display: flex;
justify-content: space-between;
`

const BalanceSkeleton = styled.div`
margin-top: 4px;
`
const CoinSkeletonWrapper = styled.div`
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Header } from '../Header'
import { WIRE_BANK_FORM } from './constants'
import { FinalStatusWrapper } from './StepsStyles'

const Failure = ({ alreadyLinked }: { alreadyLinked: boolean }) => {
const Failure = ({ message, title }: { message?: string; title?: string }) => {
const dispatch = useDispatch()
const openModals = useSelector(getModals)

Expand All @@ -32,12 +32,11 @@ const Failure = ({ alreadyLinked }: { alreadyLinked: boolean }) => {
<Header />
<Icon color='error' name='close-circle' size='3rem' />
<Text size='20px' weight={600} color='grey900'>
Unable to add bank account
{title ?? 'Unable to add bank account'}
</Text>
<Text size='16px' weight={500} color='grey600'>
{alreadyLinked
? 'This account number is already linked. Please try linking another account'
: 'There was a problem adding your bank account details. Please try to again or add a different payment method.'}
{message ??
'There was a problem adding your bank account details. Please try to again or add a different payment method.'}
</Text>
</FinalStatusWrapper>
<FlyoutFooter collapsed>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const AddWireBank = () => {
data: { api }
} = useSelector(getDomains)

const alreadyLinked = useRef(false)
const errorInfo = useRef<{ message?: string; title?: string }>({})

const resetForm = () => {
dispatch(destroy(WIRE_BANK_FORM))
Expand Down Expand Up @@ -99,8 +99,8 @@ const AddWireBank = () => {
})
setStep('SUCCESS')
dispatch(custodial.fetchCustodialBeneficiaries({ currency: fiatCurrency }))
} catch (error) {
alreadyLinked.current = error.dataFields.description.includes('already exists')
} catch ({ message, title }) {
errorInfo.current = { message, title }
setStep('FAILURE')
}
}
Expand All @@ -124,7 +124,7 @@ const AddWireBank = () => {
case 'SUCCESS':
return <Success bankName={formValues?.bankName ?? ''} fiatCurrency={fiatCurrency} />
case 'FAILURE':
return <Failure alreadyLinked={alreadyLinked.current} />
return <Failure title={errorInfo.current.title} message={errorInfo.current.message} />
case 'USER_INFO':
default: {
const nextStep =
Expand Down

0 comments on commit 83a9715

Please sign in to comment.