Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 466fee7

Browse files
fix: race condition in the baby staking fee (#1430)
* fix: race condition in the baby staking fee
1 parent 28d8bd4 commit 466fee7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ui/baby/components/PreviewModal/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
DialogHeader,
66
Heading,
77
Text,
8+
useWatch,
89
} from "@babylonlabs-io/core-ui";
910

1011
import babylon from "@/infrastructure/babylon";
@@ -40,8 +41,12 @@ export const PreviewModal = ({
4041
onSubmit,
4142
data,
4243
}: PreviewModalProps) => {
44+
const currentFeeAmount = useWatch({ name: "feeAmount" });
45+
4346
if (!data) return null;
44-
const { amount, feeAmount, validator } = data;
47+
const { amount, validator } = data;
48+
const feeAmount = currentFeeAmount ?? data.feeAmount;
49+
4550
const babyAmount = babylon.utils.ubbnToBaby(BigInt(amount));
4651
const babyFeeAmount = babylon.utils.ubbnToBaby(BigInt(feeAmount));
4752

0 commit comments

Comments
 (0)