Skip to content

Commit

Permalink
INS-493
Browse files Browse the repository at this point in the history
  • Loading branch information
sgvallala committed Dec 22, 2022
1 parent 0567d55 commit e7e5fc5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pages/programDetail/programDetailController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import _ from 'lodash';
import { useQuery } from '@apollo/client';
import CircularProgress from '@material-ui/core/CircularProgress';
import ProgramView from './programDetailView';
import { Typography } from '../../components/Wrappers/Wrappers';
import Error from '../error/Error';
import { GET_PROGRAM_DETAIL_DATA_QUERY } from '../../bento/programDetailData';
import {
GET_PROJECTS_OVERVIEW_QUERY,
Expand Down Expand Up @@ -56,11 +56,9 @@ const ProgramDetailContainer = ({ match }) => {
}

if (programDetailsLoading || projectOverviewLoading) return <CircularProgress />;
if (programDetailsError || projectOverviewError || !programDetailsData || !projectOverviewData || programDetailsData.programDetail.program_id !== match.params.id) {
if (programDetailsError || projectOverviewError || !programDetailsData || !projectOverviewData || !programDetailsData.programDetail || programDetailsData.programDetail.program_id !== match.params.id) {
return (
<Typography variant="headline" color="error" size="sm">
{programDetailsError ? `An error has occurred in loading stats component: ${programDetailsError}` : projectOverviewError ? `An error has occurred in loading stats component: ${projectOverviewError}` : 'Recieved wrong data'}
</Typography>
<Error />
);
}
return <ProgramView data={[transformedData, projectOverviewData]} />;
Expand Down

0 comments on commit e7e5fc5

Please sign in to comment.