Fix HRC721 token props on initial load

pull/171/head
artemkolodko 3 years ago
parent 14e7d2e4ff
commit 7e799a4d90
  1. 1
      src/components/ERC721_Pool.tsx
  2. 4
      src/pages/AddressPage/AddressDetails.tsx

@ -21,6 +21,7 @@ export function ERC721_Pool() {
erc721 = erc721.map((item) => {
erc721Map[item.address] = {
...item,
decimals: item.decimals || 0,
isBridged: isTokenBridged(item.address)
};
return {

@ -16,6 +16,7 @@ import { binanceAddressMap } from "src/config/BinanceAddressMap";
import { useERC1155Pool } from "src/hooks/ERC1155_Pool";
import { CircleQuestion } from "grommet-icons";
import styled from "styled-components";
import { useERC721Pool } from "../../hooks/ERC721_Pool";
export const StyledBox = styled(Box)`
transition: all 0.2s linear;
@ -38,11 +39,13 @@ interface AddressDetailsProps {
export function AddressDetailsDisplay(props: AddressDetailsProps) {
const { address, addressDescription, contracts, tokens, balance } = props;
const erc20Map = useERC20Pool();
const erc721Map = useERC721Pool();
const erc1155Map = useERC1155Pool();
const [isNewAddress, setIsNewAddress] = useState<boolean>(false);
const erc20Token = erc20Map[address] || null;
const type = getType(contracts, erc20Token);
const erc721Token = erc721Map[address] || {};
const erc1151data = erc1155Map[address] || {};
const { meta = {}, ...restErc1151data } = erc1151data;
@ -60,6 +63,7 @@ export function AddressDetailsDisplay(props: AddressDetailsProps) {
const data = {
...contracts,
...erc20Token,
...erc721Token,
token: tokens,
balance,
...restErc1151data,

Loading…
Cancel
Save