Skip to content

Commit

Permalink
fix(MarketTable): chain check
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdt committed Mar 13, 2021
1 parent 87b8136 commit 41d6753
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/MarketTable/MarketTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import TableRow from '@/components/TableRow'
import Spacer from '@/components/Spacer'

import Loader from '../Loader'
import { useWeb3React } from '@web3-react/core'

const headers = [
{
Expand All @@ -21,6 +22,8 @@ interface MarketProps {
lists: any
}
const MarketTable: React.FC<MarketProps> = ({ lists }) => {
const { chainId } = useWeb3React()

return (
<TableBody>
<StyledTableRow isHead>
Expand All @@ -31,6 +34,7 @@ const MarketTable: React.FC<MarketProps> = ({ lists }) => {
<GreyBack />
{lists?.asset ? (
lists.asset.tokens.map((token, index) => {
if (token.chainId !== chainId) return
return (
<Link
href={`/markets/${encodeURIComponent(
Expand Down Expand Up @@ -68,6 +72,7 @@ const MarketTable: React.FC<MarketProps> = ({ lists }) => {
)}
{lists.defi ? (
lists.defi.tokens.map((token, index) => {
if (token.chainId !== chainId) return
return (
<Link
href={`/markets/${encodeURIComponent(
Expand Down

0 comments on commit 41d6753

Please sign in to comment.