fix NaN when parsing empty string (#422)

This commit is contained in:
Sam Samskies 2023-03-10 06:09:23 -10:00 committed by GitHub
parent 3dccf21d2c
commit d70d77d71c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -149,9 +149,9 @@ const PreferencesPage = () => {
<div>
<input
type="number"
value={perf.defaultZapAmount}
defaultValue={perf.defaultZapAmount}
min={1}
onChange={e => dispatch(setPreferences({ ...perf, defaultZapAmount: parseInt(e.target.value) }))}
onChange={e => dispatch(setPreferences({ ...perf, defaultZapAmount: parseInt(e.target.value || "0") }))}
/>
</div>
</div>
@ -184,10 +184,10 @@ const PreferencesPage = () => {
<div>
<input
type="number"
value={perf.fastZapDonate * 100}
defaultValue={perf.fastZapDonate * 100}
min={0}
max={100}
onChange={e => dispatch(setPreferences({ ...perf, fastZapDonate: parseInt(e.target.value) / 100 }))}
onChange={e => dispatch(setPreferences({ ...perf, fastZapDonate: parseInt(e.target.value || "0") / 100 }))}
/>
</div>
</div>