diff --git a/packages/mrgn-ui/src/components/action-box-v2/actions/loop-box/loop-box.tsx b/packages/mrgn-ui/src/components/action-box-v2/actions/loop-box/loop-box.tsx index 55580d9013..bdb928adb0 100644 --- a/packages/mrgn-ui/src/components/action-box-v2/actions/loop-box/loop-box.tsx +++ b/packages/mrgn-ui/src/components/action-box-v2/actions/loop-box/loop-box.tsx @@ -93,6 +93,7 @@ export const LoopBox = ({ setMaxLeverage, setLeverage, setIsLoading, + refreshSelectedBanks, ] = useLoopBoxStore((state) => [ state.leverage, state.maxLeverage, @@ -116,6 +117,7 @@ export const LoopBox = ({ state.setMaxLeverage, state.setLeverage, state.setIsLoading, + state.refreshSelectedBanks, ]); const { priorityType, broadcastType, maxCap, maxCapType } = useActionContext(); @@ -299,6 +301,12 @@ export const LoopBox = ({ slippage, ]); + React.useEffect(() => { + if (marginfiClient) { + refreshSelectedBanks(banks); + } + }, [marginfiClient, banks, refreshSelectedBanks]); + return ( <> {actionTxns.lastValidBlockHeight && blockProgress !== 0 && ( diff --git a/packages/mrgn-ui/src/components/action-box-v2/actions/repay-collat-box/repay-collat-box.tsx b/packages/mrgn-ui/src/components/action-box-v2/actions/repay-collat-box/repay-collat-box.tsx index d34f5e4475..f6bf3ffedb 100644 --- a/packages/mrgn-ui/src/components/action-box-v2/actions/repay-collat-box/repay-collat-box.tsx +++ b/packages/mrgn-ui/src/components/action-box-v2/actions/repay-collat-box/repay-collat-box.tsx @@ -86,6 +86,7 @@ export const RepayCollatBox = ({ setRepayAmount, setMaxAmountCollateral, setIsLoading, + refreshSelectedBanks, ] = useRepayCollatBoxStore((state) => [ state.maxAmountCollateral, state.repayAmount, @@ -107,6 +108,7 @@ export const RepayCollatBox = ({ state.setRepayAmount, state.setMaxAmountCollateral, state.setIsLoading, + state.refreshSelectedBanks, ]); const { priorityType, broadcastType, maxCap, maxCapType } = useActionContext(); @@ -271,6 +273,12 @@ export const RepayCollatBox = ({ setPreviousTxn, ]); + React.useEffect(() => { + if (marginfiClient) { + refreshSelectedBanks(banks); + } + }, [marginfiClient, banks, refreshSelectedBanks]); + return ( <> {actionTxns.lastValidBlockHeight && blockProgress !== 0 && ( diff --git a/packages/mrgn-ui/src/components/action-box-v2/actions/stake-box/stake-box.tsx b/packages/mrgn-ui/src/components/action-box-v2/actions/stake-box/stake-box.tsx index 54651c6ee2..529424a221 100644 --- a/packages/mrgn-ui/src/components/action-box-v2/actions/stake-box/stake-box.tsx +++ b/packages/mrgn-ui/src/components/action-box-v2/actions/stake-box/stake-box.tsx @@ -285,6 +285,12 @@ export const StakeBox = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [actionTxns]); + React.useEffect(() => { + if (marginfiClient) { + refreshSelectedBanks(banks); + } + }, [marginfiClient, banks, refreshSelectedBanks]); + return ( <>