Skip to content

Commit

Permalink
Merge pull request #352 from vbakke/fix/351-heatmap
Browse files Browse the repository at this point in the history
Add guard for empty localStorage
  • Loading branch information
wurstbrot authored Jan 17, 2025
2 parents bf14c86 + 1524771 commit c371df7
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/app/component/circular-heatmap/circular-heatmap.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,19 @@ export class CircularHeatmapComponent implements OnInit {
data: ProjectData,
activityName: string
): any | undefined {
const activity = data.find(project =>
project.Activity.find(activity => activity.activityName === activityName)
);
if (data) {
// Find the activity in data that matches the activityName
const card = data.find(project =>
project.Activity.find(
activity => activity.activityName === activityName
)
);

if (activity) {
return activity.Activity.find(
activity => activity.activityName === activityName
)?.teamsImplemented;
if (card) {
return card.Activity.find(
activity => activity.activityName === activityName
)?.teamsImplemented;
}
}

return undefined;
Expand Down

0 comments on commit c371df7

Please sign in to comment.