Skip to content

Commit 62c9909

Browse files
authored
OCT-1498 Can't unlock GLM on M-C without going to lock view & back (#107)
1 parent 5073dfe commit 62c9909

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

client/src/components/Earn/EarnGlmLock/EarnGlmLock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const EarnGlmLock: FC<EarnGlmLockProps> = ({ currentMode, onCurrentModeChange, o
153153

154154
return (
155155
<Formik
156-
initialValues={formInitialValues}
156+
initialValues={formInitialValues(currentMode)}
157157
isInitialValid={false}
158158
onSubmit={onApproveOrDeposit}
159159
validateOnChange

client/src/components/Earn/EarnGlmLock/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { string, object, ObjectSchema } from 'yup';
33
import i18n from 'i18n';
44
import { parseUnitsBigInt } from 'utils/parseUnitsBigInt';
55

6-
import { FormFields } from './types';
6+
import { CurrentMode, FormFields } from './types';
77

8-
export const formInitialValues: FormFields = {
9-
currentMode: 'lock',
8+
export const formInitialValues = (currentMode: CurrentMode): FormFields => ({
9+
currentMode,
1010
valueToDeposeOrWithdraw: '',
11-
};
11+
});
1212

1313
export const validationSchema = (
1414
dataAvailableFunds: bigint | undefined,

0 commit comments

Comments
 (0)