Skip to content

Commit

Permalink
Actually use the routine ID when rendering the session form
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed Jan 10, 2025
1 parent dec0432 commit e0cf22f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/WorkoutRoutines/Detail/RoutineDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const RoutineDetail = () => {
}

{routine!.dayDataCurrentIteration.filter((dayData) => dayData.day !== null).map((dayData, index) =>
<DayDetailsCard dayData={dayData} key={`dayDetails-${index}`} />
<DayDetailsCard routineId={routineId} dayData={dayData} key={`dayDetails-${index}`} />
)}
</Stack>
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/WorkoutRoutines/Detail/TemplateDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const TemplateDetail = () => {
>{t('routines.copyAndUseTemplate')}</Button>

{routine!.dayDataCurrentIteration.filter((dayData) => dayData.day !== null).map((dayData, index) =>
<DayDetailsCard dayData={dayData} key={`dayDetails-${index}`} readOnly={true} />
<DayDetailsCard dayData={dayData} routineId={routineId} readOnly={true}
key={`dayDetails-${index}`} />
)}
</Stack>
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/WorkoutRoutines/widgets/RoutineDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const RoutineDetailsCard = () => {
}
<Stack spacing={2} sx={{ mt: 2 }}>
{routineQuery.data!.dayDataCurrentIteration.filter((dayData) => dayData.day !== null).map((dayData, index) =>
<DayDetailsCard dayData={dayData} key={`dayDetails-${index}`} />
<DayDetailsCard routineId={routineId} dayData={dayData} key={`dayDetails-${index}`} />
)}
</Stack>
</>}
Expand Down Expand Up @@ -144,7 +144,7 @@ function SlotDataList(props: {
);
}

export const DayDetailsCard = (props: { dayData: RoutineDayData, readOnly?: boolean }) => {
export const DayDetailsCard = (props: { dayData: RoutineDayData, routineId: number, readOnly?: boolean }) => {
const readOnly = props.readOnly ?? false;

const theme = useTheme();
Expand Down Expand Up @@ -172,7 +172,7 @@ export const DayDetailsCard = (props: { dayData: RoutineDayData, readOnly?: bool
: <Tooltip title={t('routines.addWeightLog')}>
<IconButton
href={makeLink(WgerLink.ROUTINE_ADD_LOG, i18n.language, {
id: 8,
id: props.routineId,
id2: props.dayData.day!.id
})}>
<Addchart />
Expand Down

0 comments on commit e0cf22f

Please sign in to comment.