fixed types
Some checks failed
Deploy FrontEnd / deploy-staging (push) Has been cancelled
Deploy FrontEnd / deploy-production (push) Has been cancelled
CI script / lint (push) Has been cancelled
CI script / build (push) Has been cancelled
CI script / SonarCloud (push) Has been cancelled

This commit is contained in:
hueso 2024-10-09 23:16:53 -03:00
parent fd61376b36
commit 135a01b7fd
2 changed files with 4 additions and 4 deletions

View File

@ -17,9 +17,9 @@ const Tokens: { [key in NetworkEnum]: {[key in TokenEnum] :string} } = {
};
export const getTokenByAddress = (address: string) => {
for ( let network in NetworkEnum ) {
for (const token of Object.keys(Tokens[network])) {
if (address === Tokens[network][token as TokenEnum]) {
for ( const [, network] of Object.entries(NetworkEnum) ) {
for (const token of Object.keys(Tokens[network as NetworkEnum])) {
if (address === Tokens[network as NetworkEnum][token as TokenEnum]) {
return token as TokenEnum;
}
}

View File

@ -2,7 +2,7 @@ import type { NetworkEnum, TokenEnum } from "@/model/NetworkEnum";
export const imagesPath = import.meta.glob<string>('@/assets/*.{png,svg}', { eager: true, query: '?url', import: 'default' });
export const getNetworkImage = (networkName: NetworkEnum): string => {
export const getNetworkImage = (networkName: string): string => {
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${networkName.toLowerCase()}.svg`)
);