Skip to content

Commit

Permalink
fix(unlock-app): fixing issue with cancelation and trial period
Browse files Browse the repository at this point in the history
  • Loading branch information
julien51 committed Sep 4, 2024
1 parent 3ffadd8 commit 9995faf
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,17 @@ export const CancellationForm = ({
}, [penaltyError])

useEffect(() => {
console.log(freeTrialLength)
const allowTrial = freeTrialLength > 0

setAllowTrial(freeTrialLength > 0)
setValue('freeTrialLength', allowTrial ? (freeTrialLength ?? 0) : 0, {
shouldValidate: true,
})
setValue(
'freeTrialLength',
allowTrial ? (Number(freeTrialLength) ?? 0) : 0,
{
shouldValidate: true,
}
)
}, [freeTrialLength])

useEffect(() => {
Expand Down

0 comments on commit 9995faf

Please sign in to comment.