Skip to content

Commit 2f2b1b2

Browse files
authored
fix(extension): [LW-7143]check for empty assets and next bundle coin id on add bundle (#1157)
1 parent d2438f8 commit 2f2b1b2

File tree

1 file changed

+5
-4
lines changed
  • apps/browser-extension-wallet/src/views/browser-view/features/send-transaction/components/Form

1 file changed

+5
-4
lines changed

apps/browser-extension-wallet/src/views/browser-view/features/send-transaction/components/Form/Form.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const Form = ({
5454

5555
const { setNewOutput } = useOutputs();
5656

57-
const isEmptyAssets = assetBalances?.size === 0;
57+
const isEmptyAssets = !assetBalances?.size;
5858

5959
const handleAddRow = () => {
6060
const nextBundleId = getNextBundleCoinId(spendableCoin?.toString(), assetBalances, tokensUsed, assets, cardanoCoin);
@@ -100,9 +100,10 @@ export const Form = ({
100100
const totalCost = getFee(fee.toString(), prices?.cardano?.price, cardanoCoin, fiatCurrency);
101101

102102
const hasMissingCoins = totalMinimumCoins?.coinMissing && totalMinimumCoins?.coinMissing !== '0';
103-
const bundleDisabled = spendableCoin
104-
? !getNextBundleCoinId(spendableCoin?.toString(), assetBalances, tokensUsed, assets, cardanoCoin)?.length
105-
: false;
103+
104+
const bundleDisabled =
105+
!spendableCoin ||
106+
!getNextBundleCoinId(spendableCoin?.toString(), assetBalances, tokensUsed, assets, cardanoCoin)?.length;
106107

107108
return (
108109
<Skeleton loading={isLoading}>

0 commit comments

Comments
 (0)