fix NaN when parsing empty string (#422)
This commit is contained in:
parent
3dccf21d2c
commit
d70d77d71c
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user