diff --git a/src/hooks/useTriggerOrdersFormInputs.ts b/src/hooks/useTriggerOrdersFormInputs.ts index f06c8ee6c..a0442a5be 100644 --- a/src/hooks/useTriggerOrdersFormInputs.ts +++ b/src/hooks/useTriggerOrdersFormInputs.ts @@ -119,7 +119,7 @@ export const useTriggerOrdersFormInputs = ({ } return () => { - abacusStateManager.clearTriggerOrdersInputValues(); + abacusStateManager.resetInputState(); }; }, []); diff --git a/src/lib/abacus/index.ts b/src/lib/abacus/index.ts index 06fe143e1..2c85cb7bf 100644 --- a/src/lib/abacus/index.ts +++ b/src/lib/abacus/index.ts @@ -207,8 +207,8 @@ class AbacusStateManager { field: TransferInputField.type, value: null, }); - this.clearTradeInputValues(); this.clearTriggerOrdersInputValues(); + this.clearTradeInputValues({ shouldResetSize: true }); }; // ------ Set Data ------ // diff --git a/src/views/forms/AccountManagementForms/TestnetDepositForm.tsx b/src/views/forms/AccountManagementForms/TestnetDepositForm.tsx index becab59f0..a4dd0aa67 100644 --- a/src/views/forms/AccountManagementForms/TestnetDepositForm.tsx +++ b/src/views/forms/AccountManagementForms/TestnetDepositForm.tsx @@ -18,6 +18,7 @@ import { calculateCanAccountTrade } from '@/state/accountCalculators'; import { getSubaccount } from '@/state/accountSelectors'; import { getSelectedNetwork } from '@/state/appSelectors'; +import abacusStateManager from '@/lib/abacus'; import { log } from '@/lib/telemetry'; type DepositFormProps = { @@ -43,6 +44,12 @@ export const TestnetDepositForm = ({ onDeposit, onError }: DepositFormProps) => } }, [subAccount]); + useEffect(() => { + return () => { + abacusStateManager.resetInputState(); + }; + }, []); + return ( {