Fix error when saving a set with no weight
Just default it to zero if it isn't entered.
This commit is contained in:
parent
abbe702f24
commit
cb2fa2fb0c
|
@ -99,7 +99,7 @@ export default function EditSet() {
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
if (!name) return;
|
if (!name) return;
|
||||||
|
|
||||||
let newWeight = Number(weight);
|
let newWeight = Number(weight || 0);
|
||||||
let newUnit = unit;
|
let newUnit = unit;
|
||||||
if (settings.autoConvert && unit !== settings.autoConvert) {
|
if (settings.autoConvert && unit !== settings.autoConvert) {
|
||||||
newUnit = settings.autoConvert;
|
newUnit = settings.autoConvert;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user