diff --git a/src/components/Organisms/XYK/XYKTokenDetailView/XYKTokenDetailView.tsx b/src/components/Organisms/XYK/XYKTokenDetailView/XYKTokenDetailView.tsx index b0ddd6e6..944168fb 100644 --- a/src/components/Organisms/XYK/XYKTokenDetailView/XYKTokenDetailView.tsx +++ b/src/components/Organisms/XYK/XYKTokenDetailView/XYKTokenDetailView.tsx @@ -29,6 +29,10 @@ export const XYKTokenDetailView: React.FC = ({ token_address ); setResult(new Some(response.data.items[0])); + setError({ + error: false, + error_message: "", + }); } catch (error) { setError({ error: response ? response.error : false, @@ -36,12 +40,21 @@ export const XYKTokenDetailView: React.FC = ({ }); } })(); - }, [chain_name, dex_name]); + }, [chain_name, dex_name, token_address]); if (error.error) { return <>{error.error_message}; } + if ( + !maybeResult.match({ + None: () => null, + Some: (result) => result, + }) + ) { + return <>No data found.; + } + return (