Fix cost not set after form reset

This commit is contained in:
ekzyis 2023-08-12 02:40:37 +02:00
parent 5b821906cf
commit 4d725272e3
1 changed files with 4 additions and 4 deletions

View File

@ -82,8 +82,8 @@ export default function FeeButton ({ parentId, hasImgLink, baseFee, ChildButton,
const cost = baseFee * (hasImgLink ? 10 : 1) * Math.pow(10, repetition) + Number(boost)
useEffect(() => {
formik.setFieldValue('cost', cost)
}, [cost])
formik?.setFieldValue('cost', cost)
}, [formik?.getFieldProps('cost').value, cost])
const show = alwaysShow || !formik?.isSubmitting
return (
@ -142,8 +142,8 @@ export function EditFeeButton ({ paidSats, hadImgLink, hasImgLink, ChildButton,
const cost = (addImgLink ? paidSats * 9 : 0) + Number(boost)
useEffect(() => {
formik.setFieldValue('cost', cost)
}, [cost])
formik?.setFieldValue('cost', cost)
}, [formik?.getFieldProps('cost').value, cost])
const show = alwaysShow || !formik?.isSubmitting
return (