Fix error when saving a set with no weight

Just default it to zero if it isn't entered.
This commit is contained in:
Brandon Presley 2023-11-21 17:44:53 +13:00
parent abbe702f24
commit cb2fa2fb0c
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ export default function EditSet() {
const handleSubmit = async () => {
if (!name) return;
let newWeight = Number(weight);
let newWeight = Number(weight || 0);
let newUnit = unit;
if (settings.autoConvert && unit !== settings.autoConvert) {
newUnit = settings.autoConvert;