1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

[Bug]: Enabling the display of token total in SetApprovalForAll (#18863)

This commit is contained in:
Niranjana Binoy 2023-05-18 09:51:38 -04:00 committed by GitHub
parent 67614593a8
commit 3fe5d3fc4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,7 +107,7 @@ const ConfirmPageContainer = (props) => {
const t = useI18nContext(); const t = useI18nContext();
const trackEvent = useContext(MetaMetricsContext); const trackEvent = useContext(MetaMetricsContext);
const [collectionBalance, setCollectionBalance] = useState(0); const [collectionBalance, setCollectionBalance] = useState('0');
const isBuyableChain = useSelector(getIsBuyableChain); const isBuyableChain = useSelector(getIsBuyableChain);
const contact = useSelector((state) => getAddressBookEntry(state, toAddress)); const contact = useSelector((state) => getAddressBookEntry(state, toAddress));
@ -145,7 +145,7 @@ const ConfirmPageContainer = (props) => {
fromAddress, fromAddress,
global.ethereumProvider, global.ethereumProvider,
); );
setCollectionBalance(tokenBalance?.balance?.words?.[0] || 0); setCollectionBalance(tokenBalance.toString() || '0');
}, [fromAddress, tokenAddress]); }, [fromAddress, tokenAddress]);
///: BEGIN:ONLY_INCLUDE_IN(snaps) ///: BEGIN:ONLY_INCLUDE_IN(snaps)
@ -310,7 +310,7 @@ const ConfirmPageContainer = (props) => {
collectionName={title} collectionName={title}
senderAddress={fromAddress} senderAddress={fromAddress}
name={fromName} name={fromName}
isERC721={assetStandard === TokenStandard.ERC20} isERC721={assetStandard === TokenStandard.ERC721}
total={collectionBalance} total={collectionBalance}
onSubmit={onSubmit} onSubmit={onSubmit}
onCancel={onCancel} onCancel={onCancel}