Skip to content

Commit

Permalink
refactor(general info step): prevents NaN values to getting input to …
Browse files Browse the repository at this point in the history
…fingerprint duration

Adds a previous validation to avoid NaN possible values. Also refactors some unnecessary related
code on that

fix #435
  • Loading branch information
aguzmant103 committed Apr 3, 2024
1 parent 2920f64 commit 41a501e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ export default function GeneralInfoStep({
size="lg"
value={_fingerprintDuration}
onChange={(value) =>
setFingerprintDuration(Number(value))
!Number.isNaN(Number(value)) &&
Number(value) >= 0
? setFingerprintDuration(Number(value))
: null
}
onBlur={() =>
onSubmit(
Expand Down Expand Up @@ -205,7 +208,6 @@ export default function GeneralInfoStep({
!_groupName ||
(group.type === "off-chain" &&
(_fingerprintDuration === undefined ||
Number.isNaN(_fingerprintDuration) ||
!_groupDescription ||
_groupDescription.length < 10)) ||
_fingerprintDuration < 0
Expand Down

0 comments on commit 41a501e

Please sign in to comment.