Skip to content

Commit

Permalink
fix: correct zero contribution top repos language distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
0-vortex committed Apr 9, 2023
1 parent bee0e6e commit 7d82c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/social-card/templates/user-langs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const userLangs = (langs: (Language & { size: number })[], totalCount = 0, joinL
.map(({ color, size }) => {
const realPercent = Math.round(size / totalCount * 100);

return `<div tw="h-12px ${color ? `bg-[${color}]` : "bg-black"}" style="width: ${totalCount > 0 ? realPercent : 100 / langs.length}%"/>`;
return `<div tw="h-12px ${color ? `bg-[${color}]` : "bg-black"}" style="width: ${totalCount > 0 ? realPercent : 100 / filteredLangs.length}%"/>`;
})
.join(joinLiteral);
};
Expand Down

0 comments on commit 7d82c0d

Please sign in to comment.