Fix crashing of plans

This commit is contained in:
Brandon Presley 2022-10-30 13:15:31 +13:00
parent 8a240b78cd
commit e1a90a98fb
2 changed files with 4 additions and 3 deletions

View File

@ -72,7 +72,8 @@ export default function StartPlan() {
else toast('Added set', 3000); else toast('Added set', 3000);
if (!settings.alarm) return; if (!settings.alarm) return;
const milliseconds = Number(minutes) * 60 * 1000 + Number(seconds) * 1000; 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); NativeModules.AlarmModule.timer(...args);
}; };

View File

@ -163,9 +163,9 @@ export const countMany = async (names: string[]): Promise<CountMany[]> => {
const questions = names.map(_ => '?').join(','); const questions = names.map(_ => '?').join(',');
console.log({questions, names}); console.log({questions, names});
const select = ` const select = `
SELECT workouts.name, COUNT(sets.id) as total, workouts.sets SELECT workouts.name, COUNT(sets.id) as total
FROM ( FROM (
SELECT distinct name, sets FROM sets SELECT distinct name FROM sets
WHERE name IN (${questions}) WHERE name IN (${questions})
) workouts ) workouts
LEFT JOIN sets ON sets.name = workouts.name LEFT JOIN sets ON sets.name = workouts.name