Skip to content

Commit 536f470

Browse files
committed
fix: alert on which chain
1 parent b105c8c commit 536f470

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/components/appBox.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ export default function AppBox() {
8787
updateTargetNativeBalance,
8888
]);
8989

90-
const sourceChainRef = useRef(sourceChain);
91-
const targetChainRef = useRef(targetChain);
92-
9390
const cross = bridgeInstance?.getCrossInfo();
9491
const assetLimit = assetLimitOnTargetChain?.amount;
9592
const assetSupply = targetAssetSupply?.amount;
@@ -166,13 +163,13 @@ export default function AppBox() {
166163
fee.amount,
167164
feeBalanceOnSourceChain.currency.decimals,
168165
)} ${feeBalanceOnSourceChain.currency.symbol} in your Sender on ${
169-
sourceChainRef.current.name
166+
sourceChain.name
170167
} to cover cross-chain fees.`}</span>
171168
</div>
172169
);
173170
}
174171
return null;
175-
}, [bridgeInstance, feeBalanceOnSourceChain]);
172+
}, [bridgeInstance, feeBalanceOnSourceChain, sourceChain]);
176173

177174
const existentialAlertOnSourceChain = useMemo(() => {
178175
if (
@@ -214,13 +211,13 @@ export default function AppBox() {
214211
existentialDepositOnTargetChain.amount,
215212
existentialDepositOnTargetChain.currency.decimals,
216213
)} ${existentialDepositOnTargetChain.currency.symbol} in your Recipient on ${
217-
targetChainRef.current.name
214+
targetChain.name
218215
} to keep an account open.`}</span>
219216
</div>
220217
);
221218
}
222219
return null;
223-
}, [targetNativeBalance, existentialDepositOnTargetChain]);
220+
}, [targetNativeBalance, existentialDepositOnTargetChain, targetChain]);
224221

225222
const disabledSend =
226223
!sender?.address ||

0 commit comments

Comments
 (0)