Skip to content

Commit

Permalink
fix(extension): [LW-7143]check for empty assets and next bundle coin …
Browse files Browse the repository at this point in the history
…id on add bundle (#1157)
  • Loading branch information
vetalcore authored May 14, 2024
1 parent d2438f8 commit 2f2b1b2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const Form = ({

const { setNewOutput } = useOutputs();

const isEmptyAssets = assetBalances?.size === 0;
const isEmptyAssets = !assetBalances?.size;

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

const hasMissingCoins = totalMinimumCoins?.coinMissing && totalMinimumCoins?.coinMissing !== '0';
const bundleDisabled = spendableCoin
? !getNextBundleCoinId(spendableCoin?.toString(), assetBalances, tokensUsed, assets, cardanoCoin)?.length
: false;

const bundleDisabled =
!spendableCoin ||
!getNextBundleCoinId(spendableCoin?.toString(), assetBalances, tokensUsed, assets, cardanoCoin)?.length;

return (
<Skeleton loading={isLoading}>
Expand Down

0 comments on commit 2f2b1b2

Please sign in to comment.