Skip to content

Commit fdc5c9b

Browse files
Adez017Copilot
andauthored
Update src/lib/statsProvider.tsx
Co-authored-by: Copilot <[email protected]>
1 parent ac1d864 commit fdc5c9b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib/statsProvider.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,9 @@ const calculatePointsForPR = (labels?: Array<{ name: string }>): number => {
117117
'level 2': 30,
118118
'level 3': 50,
119119
};
120-
for (const level of Object.keys(levelPointsMap)) {
121-
if (labelNames.includes(level)) {
122-
return levelPointsMap[level];
123-
}
120+
const matchedLevel = labelNames.find(label => levelPointsMap.hasOwnProperty(label));
121+
if (matchedLevel) {
122+
return levelPointsMap[matchedLevel];
124123
}
125124

126125
return 0; // No points if no level label

0 commit comments

Comments
 (0)