From 5d4cdfc7ae3cfa21d9bc32c5a7618d9fbbed8f36 Mon Sep 17 00:00:00 2001 From: Piotr Matlak Date: Tue, 3 Dec 2024 16:50:18 +0100 Subject: [PATCH] fix refreshing chart --- src/containers/NewPositionWrapper/NewPositionWrapper.tsx | 6 +++--- src/utils/web3/adapters/backpack.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/containers/NewPositionWrapper/NewPositionWrapper.tsx b/src/containers/NewPositionWrapper/NewPositionWrapper.tsx index c267966d..d77b8ba5 100644 --- a/src/containers/NewPositionWrapper/NewPositionWrapper.tsx +++ b/src/containers/NewPositionWrapper/NewPositionWrapper.tsx @@ -282,7 +282,7 @@ export const NewPositionWrapper: React.FC = ({ ) } } - }, [isWaitingForNewPool, allPools]) + }, [isWaitingForNewPool, allPools.length]) useEffect(() => { if (poolIndex !== null) { @@ -409,16 +409,16 @@ export const NewPositionWrapper: React.FC = ({ const [tokenAPriceData, setTokenAPriceData] = useState(undefined) const [priceALoading, setPriceALoading] = useState(false) + useEffect(() => { if (tokenA === null || (tokenA !== null && !tokens[tokenA.toString()])) { return } - console.log(tokens[tokenA.toString()]) + if (tokenA) { setPriceALoading(true) getTokenPrice(tokenA.toString(), tokens[tokenA.toString()]?.coingeckoId) .then(data => { - console.log('data', data) return setTokenAPriceData(data) }) .catch(() => setTokenAPriceData(undefined)) diff --git a/src/utils/web3/adapters/backpack.ts b/src/utils/web3/adapters/backpack.ts index 4613cf1f..e97cc104 100644 --- a/src/utils/web3/adapters/backpack.ts +++ b/src/utils/web3/adapters/backpack.ts @@ -43,7 +43,7 @@ export class BackpackWalletAdapter implements WalletAdapter { } let provider: BackpackProvider if ((window as any)?.backpack) { - provider = (window as any).backpack + provider = (window as any).backpack.solana } else { return }