Skip to content

Commit

Permalink
getTokenIcon debugging #30
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelPepe committed Oct 20, 2023
1 parent fd16833 commit ec49cab
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions frontend/src/components/tokenIconsCell/TokenIconsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,28 @@ export const TokenIconsCell: FC<TokensIconsPropsI> = ({ anchorCurrency, tokens }
const polygonData: ITokenObject[] = polygonPopular;

const getTokenIcon = (tokenAddress: string) => {
console.log('123s', typeof tokenAddress);
for (const elem of polygonData) {
if (elem.address === tokenAddress) {
if (elem.address == tokenAddress) {
console.log('---', elem.address);
console.log('---', tokenAddress);
console.log(elem);
return elem;
}
}
};

const getAllTokensIcons = () => {
setAnchorCurrencyInfo(getTokenIcon(anchorCurrency));
const test = getTokenIcon(anchorCurrency);
console.log('test', test);
setAnchorCurrencyInfo(test);
const tokensInfoList: ITokenObject[] = tokens
.map((token) => getTokenIcon(token))
.filter((token): token is ITokenObject => {
return token !== undefined;
});
setTokensInfo(tokensInfoList);
// console.log('result', tokensInfoList);
};
useEffect(() => {
getAllTokensIcons();
Expand Down

0 comments on commit ec49cab

Please sign in to comment.