Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a good fix!

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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good change to enable reload of achievements.

);

/**
Expand Down
Loading