parent
5da73a0e3e
commit
f320d16c4b
|
@ -47,7 +47,7 @@ export default function SetList() {
|
|||
if (!settings.predict) return setSet({...defaultSet});
|
||||
const todaysPlan = await getTodaysPlan();
|
||||
console.log(`${SetList.name}.predict:`, {todaysPlan});
|
||||
if (todaysPlan.length === 0) return;
|
||||
if (todaysPlan.length === 0) return setSet({...defaultSet});
|
||||
const todaysSets = await getTodaysSets();
|
||||
const todaysWorkouts = todaysPlan[0].workouts.split(',');
|
||||
let workout = todaysWorkouts[0];
|
||||
|
@ -114,6 +114,7 @@ export default function SetList() {
|
|||
}, [search, end, offset, sets]);
|
||||
|
||||
const onAdd = useCallback(async () => {
|
||||
console.log(`${SetList.name}.onAdd`, {set, defaultSet, workouts});
|
||||
navigation.navigate('EditSet', {
|
||||
set: set || {...defaultSet},
|
||||
workouts,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {db, defaultSet} from './db';
|
||||
import {db} from './db';
|
||||
import {Periods} from './periods';
|
||||
import Set from './set';
|
||||
import {defaultSet} from './set.service';
|
||||
import Volume from './volume';
|
||||
|
||||
export const getBestSet = async (name: string): Promise<Set> => {
|
||||
|
|
8
db.ts
8
db.ts
|
@ -140,11 +140,3 @@ export interface PageParams {
|
|||
limit: number;
|
||||
offset: number;
|
||||
}
|
||||
|
||||
export const defaultSet = {
|
||||
name: '',
|
||||
id: 0,
|
||||
reps: 10,
|
||||
weight: 20,
|
||||
unit: 'kg',
|
||||
};
|
||||
|
|
|
@ -84,9 +84,8 @@ export const getTodaysSets = async (): Promise<Set[]> => {
|
|||
return result.rows.raw();
|
||||
};
|
||||
|
||||
export const defaultSet = {
|
||||
export const defaultSet: Set = {
|
||||
name: '',
|
||||
id: 0,
|
||||
reps: 10,
|
||||
weight: 20,
|
||||
unit: 'kg',
|
||||
|
|
Loading…
Reference in New Issue
Block a user