From 866f9b01b8e4ecfc0c1ef595f7c8dd21555c2173 Mon Sep 17 00:00:00 2001 From: Nelito Junior Date: Thu, 6 Feb 2025 16:50:35 -0300 Subject: [PATCH] refactor: remove default values from TxFeeOptions form fields --- .../components/TxFeeOptions/TxFeeOptions.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/app/src/systems/Transaction/components/TxFeeOptions/TxFeeOptions.tsx b/packages/app/src/systems/Transaction/components/TxFeeOptions/TxFeeOptions.tsx index c2996474b..d794c5e2d 100644 --- a/packages/app/src/systems/Transaction/components/TxFeeOptions/TxFeeOptions.tsx +++ b/packages/app/src/systems/Transaction/components/TxFeeOptions/TxFeeOptions.tsx @@ -50,19 +50,11 @@ export const TxFeeOptions = ({ const { field: tip, fieldState: tipState } = useController({ control, name: 'fees.tip', - defaultValue: { - amount: regularTip, - text: formatTip(regularTip), - }, }); const { field: gasLimit, fieldState: gasLimitState } = useController({ control, name: 'fees.gasLimit', - defaultValue: { - amount: gasLimitInput, - text: gasLimitInput.toString(), - }, }); const advancedFee = baseFee.add(tip.value?.amount || bn(0)); @@ -96,14 +88,14 @@ export const TxFeeOptions = ({ 'fees.gasLimit.amount', ]); - if (!currentGasLimit?.eq(previousGasLimit.current)) { + if (!currentGasLimit.eq(previousGasLimit.current)) { setValue('fees.gasLimit', { amount: previousGasLimit.current, text: previousGasLimit.current.toString(), }); } - if (!currentTip?.eq(previousDefaultTip.current)) { + if (!currentTip.eq(previousDefaultTip.current)) { setValue('fees.tip', { amount: previousDefaultTip.current, text: formatTip(previousDefaultTip.current),