Skip to content

Commit

Permalink
fix(tangle-dapp): Fix total error chip not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
yurixander committed Aug 26, 2024
1 parent b2bbb5e commit b8e3936
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BN } from '@polkadot/util';
import { FC, useMemo } from 'react';

import { EMPTY_VALUE_PLACEHOLDER } from '../../../constants';
import { LST_PREFIX } from '../../../constants/liquidStaking/constants';
import { LsProtocolId } from '../../../constants/liquidStaking/types';
import useLsExchangeRate, {
ExchangeRateType,
Expand Down Expand Up @@ -65,9 +66,11 @@ const TotalDetailItem: FC<TotalDetailItemProps> = ({
return formatBn(totalAmount, protocol.decimals);
}, [inputAmount, totalAmount, protocol.decimals]);

const token = isMinting ? `${LST_PREFIX}${protocol.token}` : protocol.token;

const value =
formattedTotalAmount instanceof BN
? `${formattedTotalAmount} ${protocol.token}`
typeof formattedTotalAmount === 'string'
? `${formattedTotalAmount} ${token}`
: formattedTotalAmount;

return (
Expand Down
1 change: 1 addition & 0 deletions apps/tangle-dapp/hooks/useInputAmount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const useInputAmount = ({
return;
}

// TODO: Format the new amount string to include commas. Use `INPUT_AMOUNT_FORMAT`.
setDisplayAmount(cleanAmountString);

const amountOrError = safeParseInputAmount({
Expand Down

0 comments on commit b8e3936

Please sign in to comment.