diff --git a/StartPlan.tsx b/StartPlan.tsx index 78f2908a..3815c540 100644 --- a/StartPlan.tsx +++ b/StartPlan.tsx @@ -72,7 +72,8 @@ export default function StartPlan() { else toast('Added set', 3000); if (!settings.alarm) return; const milliseconds = Number(minutes) * 60 * 1000 + Number(seconds) * 1000; - const args = [milliseconds, !!settings.vibrate, settings.sound]; + const {vibrate, sound, noSound} = settings; + const args = [milliseconds, !!vibrate, sound, !!noSound]; NativeModules.AlarmModule.timer(...args); }; diff --git a/set.service.ts b/set.service.ts index 2db8377b..c9d63c5d 100644 --- a/set.service.ts +++ b/set.service.ts @@ -163,9 +163,9 @@ export const countMany = async (names: string[]): Promise => { const questions = names.map(_ => '?').join(','); console.log({questions, names}); const select = ` - SELECT workouts.name, COUNT(sets.id) as total, workouts.sets + SELECT workouts.name, COUNT(sets.id) as total FROM ( - SELECT distinct name, sets FROM sets + SELECT distinct name FROM sets WHERE name IN (${questions}) ) workouts LEFT JOIN sets ON sets.name = workouts.name