From 052b2f61e0196f558dbbba23a4119ef595632b3b Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Fri, 9 Jul 2021 14:13:31 -0300 Subject: [PATCH] Fixes for the production docker image --- src/components/MethodName.tsx | 2 +- src/components/TokenLogo.tsx | 2 +- src/useConfig.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/MethodName.tsx b/src/components/MethodName.tsx index 974e69e..3a4d710 100644 --- a/src/components/MethodName.tsx +++ b/src/components/MethodName.tsx @@ -26,7 +26,7 @@ const MethodName: React.FC = ({ data }) => { return; } - const signatureURL = fourBytesURL(config.assetsURLPrefix, fourBytes); + const signatureURL = fourBytesURL(config.assetsURLPrefix ?? "", fourBytes); fetch(signatureURL) .then(async (res) => { if (!res.ok) { diff --git a/src/components/TokenLogo.tsx b/src/components/TokenLogo.tsx index fab9e2c..cc2e756 100644 --- a/src/components/TokenLogo.tsx +++ b/src/components/TokenLogo.tsx @@ -19,7 +19,7 @@ const InternalTokenLogo: React.FC = ({ address, name }) => { const srcList: string[] = []; if (config) { - srcList.push(tokenLogoURL(config.assetsURLPrefix, address)); + srcList.push(tokenLogoURL(config.assetsURLPrefix ?? "", address)); } srcList.push("/eth-diamond-black.png"); const { src } = useImage({ srcList }); diff --git a/src/useConfig.ts b/src/useConfig.ts index 4e53fb6..3bb4858 100644 --- a/src/useConfig.ts +++ b/src/useConfig.ts @@ -1,8 +1,8 @@ import { useState, useEffect } from "react"; export type OtterscanConfig = { - erigonURL: string; - assetsURLPrefix: string; + erigonURL?: string; + assetsURLPrefix?: string; }; export const useConfig = (): [boolean?, OtterscanConfig?] => {