Merge pull request #171 from ArtemKolodko/fix_hrc721_properties

Fix HRC721 token props on initial load
pull/173/head
Artem 3 years ago committed by GitHub
commit 8afa587f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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