Skip to content

Commit 16be7a7

Browse files
authored
Simplify heatmap data checks for contributions and communications
1 parent 6f6cf28 commit 16be7a7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • frontend/src/app/board/[year]/candidates

frontend/src/app/board/[year]/candidates/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ const BoardCandidatesPage = () => {
458458
</div>
459459
</div>
460460
{snapshot.contributionHeatmapData &&
461-
Object.keys(snapshot.contributionHeatmapData).length > 0 && (
461+
Object.values(snapshot.contributionHeatmapData).some(
462+
(count) => count > 0
463+
) && (
462464
<div className="mt-3">
463465
<ContributionHeatmap
464466
contributionData={snapshot.contributionHeatmapData}
@@ -619,7 +621,9 @@ const BoardCandidatesPage = () => {
619621

620622
{/* Slack Communications Heatmap */}
621623
{snapshot?.communicationHeatmapData &&
622-
Object.keys(snapshot.communicationHeatmapData).length > 0 && (
624+
Object.values(snapshot.communicationHeatmapData).some(
625+
(count) => count > 0
626+
) && (
623627
<div className="mt-4 w-full border-t border-gray-200 pt-4 dark:border-gray-700">
624628
<ContributionHeatmap
625629
contributionData={snapshot.communicationHeatmapData}

0 commit comments

Comments
 (0)