From ea7a8c3272c1817208d5f73e00f13ae339b21995 Mon Sep 17 00:00:00 2001 From: mohandast52 Date: Wed, 6 Nov 2024 18:25:45 +0530 Subject: [PATCH] refactor: rename getLatestBridgeTokenAmount to updateLatestBridgeTokenAmount for clarity --- .../Bonding/TokenManagement/hooks/useWsolDeposit.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/bond/components/BondingProducts/Bonding/TokenManagement/hooks/useWsolDeposit.jsx b/apps/bond/components/BondingProducts/Bonding/TokenManagement/hooks/useWsolDeposit.jsx index ae6c34d4..f594ee5f 100644 --- a/apps/bond/components/BondingProducts/Bonding/TokenManagement/hooks/useWsolDeposit.jsx +++ b/apps/bond/components/BondingProducts/Bonding/TokenManagement/hooks/useWsolDeposit.jsx @@ -125,7 +125,7 @@ export const useWsolDeposit = () => { const customGetOrCreateAssociatedTokenAccount = useGetOrCreateAssociatedTokenAccount(); const program = new Program(idl, PROGRAM_ID, anchorProvider); - const getLatestBridgeTokenAmount = useCallback(async () => { + const updateLatestBridgeTokenAmount = useCallback(async () => { if (!svmWalletPublicKey) return; if (!connection) return; @@ -138,8 +138,8 @@ export const useWsolDeposit = () => { }, [connection, svmWalletPublicKey]); useEffect(() => { - getLatestBridgeTokenAmount(); - }, [getLatestBridgeTokenAmount]); + updateLatestBridgeTokenAmount(); + }, [updateLatestBridgeTokenAmount]); const getDepositIncreaseLiquidityQuote = async ({ sol, slippage }) => { const { whirlpoolData, whirlpoolTokenA, whirlpoolTokenB } = await getWhirlpoolData(); @@ -336,7 +336,7 @@ export const useWsolDeposit = () => { // wait for 2 seconds to allow the transaction to be processed await new Promise((resolve) => setTimeout(resolve, 2000)); - await getLatestBridgeTokenAmount(); // refetch bridged token amount + await updateLatestBridgeTokenAmount(); // refetch bridged token amount return quote.liquidityAmount.toString(); };