Skip to content

Commit

Permalink
Merge branch 'master' into fix-admin-panel-assessment-configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
RichDom2185 authored Oct 29, 2024
2 parents 741c547 + 105546f commit 2f14443
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/commons/assessmentWorkspace/AssessmentWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ const AssessmentWorkspace: React.FC<AssessmentWorkspaceProps> = props => {
}, []);

useEffect(() => {
handleTeamOverviewFetch(props.assessmentId);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
if (assessmentOverview && assessmentOverview.maxTeamSize > 1) {
handleTeamOverviewFetch(props.assessmentId);
}
}, [assessmentOverview, handleTeamOverviewFetch, props.assessmentId]);

/**
* After mounting (either an older copy of the assessment
Expand Down
7 changes: 1 addition & 6 deletions src/pages/achievement/control/AchievementControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,13 @@ const AchievementControl: React.FC = () => {
[dispatch]
);

// TODO: This is a hacky fix. By right, we shouldn't need to use an
// inferencer instance since we can encapsulate the logic using hooks
// and component state.
const [initialAchievements, initialGoals] = useTypedSelector(state => [
state.achievement.achievements,
state.achievement.goals
]);
const inferencer = useMemo(
() => new AchievementInferencer(initialAchievements, initialGoals),
// We only want to create the inferencer once
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
[initialAchievements, initialGoals]
);

/**
Expand Down

0 comments on commit 2f14443

Please sign in to comment.