Better number handling

This commit is contained in:
Greg Shuflin 2022-12-07 21:34:45 -08:00
parent 9d6fc961de
commit 8b7c7ecb33

View File

@ -39,8 +39,13 @@ function Addresses(props: AddressesProps) {
setInputState("");
}
const num = isNaN(numTokens) ? 0 : numTokens;
var num;
if (isNan(numTokens) || numTokens < 0) {
num = 0;
} else {
num = numTokens;
}
return (
<div>