From d1e3255a2825aa5c5bc27e8f0f2619cbcfdc3cc8 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Sat, 9 Jul 2022 15:29:36 +1200 Subject: [PATCH] Allow zero reps/weight but not null --- EditSet.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EditSet.tsx b/EditSet.tsx index 8669eb5..8b3744b 100644 --- a/EditSet.tsx +++ b/EditSet.tsx @@ -17,6 +17,8 @@ export default function EditSet({ const db = useContext(DatabaseContext); const save = async () => { + if (!set?.name || set?.reps === undefined || set?.weight === undefined) + return; if (!set?.id) await db.executeSql( `INSERT INTO sets(name, reps, weight, created, unit) VALUES (?,?,?,?,?)`,