Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: app crash due to minimal input must be string error #10842

Merged
merged 9 commits into from
Sep 11, 2024
8 changes: 3 additions & 5 deletions app/components/Views/confirmations/SendFlow/Amount/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ class Amount extends PureComponent {
contractExchangeRates,
} = this.props;
const { internalPrimaryCurrencyIsCrypto, estimatedTotalGas } = this.state;
const tokenBalance = contractBalances[selectedAsset.address] || '0x0';
let input;
if (selectedAsset.isETH) {
const balanceBN = hexToBN(accounts[selectedAddress].balance);
Expand All @@ -907,15 +908,12 @@ class Amount extends PureComponent {
: undefined;
if (internalPrimaryCurrencyIsCrypto || !exchangeRate) {
input = fromTokenMinimalUnitString(
contractBalances[selectedAsset.address]?.toString(10),
tokenBalance,
selectedAsset.decimals,
);
} else {
input = `${balanceToFiatNumber(
fromTokenMinimalUnitString(
contractBalances[selectedAsset.address]?.toString(10),
selectedAsset.decimals,
),
fromTokenMinimalUnitString(tokenBalance, selectedAsset.decimals),
conversionRate,
exchangeRate,
)}`;
Expand Down
Loading