diff --git a/src/App.tsx b/src/App.tsx index a99a84e..1acdd92 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useState } from "react"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; import ReactGA from "react-ga4"; import "./App.css"; import socketService from "./services/socketService"; @@ -256,7 +256,7 @@ function App() { }; }, [userInfo?.address]); - const getCoinLabel = (coin?: string)=> { + const getCoinLabel = useCallback((coin?: string)=> { switch(coin || selectedCoin){ case "LITECOIN":{ @@ -285,7 +285,7 @@ function App() { default: return null } - } + }, [selectedCoin]) const gameContextValue: IContextProps = { userInfo, diff --git a/src/components/Grids/TradeOffers.tsx b/src/components/Grids/TradeOffers.tsx index 28dbbbc..aba4c44 100644 --- a/src/components/Grids/TradeOffers.tsx +++ b/src/components/Grids/TradeOffers.tsx @@ -218,7 +218,7 @@ export const TradeOffers: React.FC = ({ foreignCoinBalance }: any) => { }, }, ]; - }, [qortalNames]); + }, [qortalNames, getCoinLabel]); // const onRowClicked = (event: any) => { // if(listOfOngoingTradesAts.includes(event.data.qortalAtAddress)) return diff --git a/src/components/history/HistoryList.tsx b/src/components/history/HistoryList.tsx index 2d7cf06..4da4fd4 100644 --- a/src/components/history/HistoryList.tsx +++ b/src/components/history/HistoryList.tsx @@ -136,7 +136,7 @@ export default function HistoryList({ qortAddress, historyList }) { }, ]; - }, [selectedCoin, qortalNames]) + }, [selectedCoin, qortalNames, getCoinLabel]) diff --git a/src/components/sell/TradeBotList.tsx b/src/components/sell/TradeBotList.tsx index 20f6378..8b52fa1 100644 --- a/src/components/sell/TradeBotList.tsx +++ b/src/components/sell/TradeBotList.tsx @@ -101,7 +101,7 @@ export default function TradeBotList({ qortAddress, failedTradeBots }) { resizable: true, }, ]; - }, [selectedCoin]); + }, [selectedCoin, getCoinLabel]); useEffect(() => { if (qortAddress) { qortAddressRef.current = qortAddress;