Skip to content

Commit ac1d864

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

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/lib/statsProvider.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,15 @@ const calculatePointsForPR = (labels?: Array<{ name: string }>): number => {
112112
}
113113

114114
// Check for level labels and assign points accordingly with new point system
115-
if (labelNames.includes('level 1')) {
116-
return 10;
117-
} else if (labelNames.includes('level 2')) {
118-
return 30;
119-
} else if (labelNames.includes('level 3')) {
120-
return 50;
115+
const levelPointsMap: { [key: string]: number } = {
116+
'level 1': 10,
117+
'level 2': 30,
118+
'level 3': 50,
119+
};
120+
for (const level of Object.keys(levelPointsMap)) {
121+
if (labelNames.includes(level)) {
122+
return levelPointsMap[level];
123+
}
121124
}
122125

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

0 commit comments

Comments
 (0)