From 465df177413afba5376682bd23a712066bd0385c Mon Sep 17 00:00:00 2001 From: Vojtech Simetka Date: Thu, 3 Jun 2021 13:18:58 +0200 Subject: [PATCH] fix: typeerror in the postage stamps form (#137) --- src/pages/stamps/CreatePostageStampModal.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/stamps/CreatePostageStampModal.tsx b/src/pages/stamps/CreatePostageStampModal.tsx index 6a9084f..14c3480 100644 --- a/src/pages/stamps/CreatePostageStampModal.tsx +++ b/src/pages/stamps/CreatePostageStampModal.tsx @@ -63,7 +63,8 @@ export default function FormDialog({ label }: Props): ReactElement { initialValues={initialFormValues} onSubmit={async (values: FormValues, actions: FormikHelpers) => { try { - if (!values.depth) return + // This is really just a typeguard, the validation pretty much guarantees these will have the right values + if (!values.depth || !values.amount) return const amount = BigInt(values.amount) const depth = Number.parseInt(values.depth) @@ -105,7 +106,7 @@ export default function FormDialog({ label }: Props): ReactElement { return errors }} > - {({ submitForm, isValid, isSubmitting }) => ( + {({ submitForm, isValid, isSubmitting, values }) => (