Skip to content

Commit

Permalink
Merge pull request #526 from EscolaLMS/bugfix/REK-91
Browse files Browse the repository at this point in the history
fixed consultation term undefined error
  • Loading branch information
victazzz authored Dec 10, 2024
2 parents 88f9fec + a024564 commit 14942b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const StyledModal = styled(Modal)`
}
`;

const FRAME_RATE = 0.3;
const FRAME_RATE = 3;

declare global {
interface Window {
Expand Down
9 changes: 7 additions & 2 deletions src/components/Profile/ProfileConsultations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const ProfileConsultations = ({ type }: ProfileConsultationsProps) => {
);
setConsultationsData((prev) => {
const index = prev.findIndex(
(consultation) => consultation.consultation_term_id === termId
(consultation) => consultation?.consultation_term_id === termId
);

if (index !== -1) {
Expand All @@ -86,7 +86,12 @@ const ProfileConsultations = ({ type }: ProfileConsultationsProps) => {
consultationsData.forEach((consultation) => {
if (!consultation.is_started && !consultation.is_ended) {
// @ts-ignore
refreshConsultation(consultation.id, consultation.consultation_term_id);
if (consultation?.consultation_term_id !== undefined) {
refreshConsultation(
consultation?.id,
consultation?.consultation_term_id
);
}
}
});
}, [consultationsData, refreshConsultation]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Profile/ProfileTutorConsultations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const ProfileTutorConsultations = ({
refreshConsultation(
// @ts-ignore
consultation?.consultation_id,
consultation.consultation_term_id
consultation?.consultation_term_id
);
}
});
Expand Down

0 comments on commit 14942b6

Please sign in to comment.