fix: fixed sorting of languages by percentage

This commit is contained in:
anuraghazra 2020-07-21 19:58:13 +05:30
parent ad87824f3c
commit 8a8ff5b390

View File

@ -41,10 +41,12 @@ const renderTopLanguages = (topLangs, options = {}) => {
}, 0);
// hide langs
langs = langs.filter((lang) => {
if (!hide_langs_below) return true;
return (lang.size / totalSize) * 100 > hide_langs_below;
});
langs = langs
.sort((a, b) => b.size - a.size)
.filter((lang) => {
if (!hide_langs_below) return true;
return (lang.size / totalSize) * 100 > hide_langs_below;
});
// returns theme based colors with proper overrides and defaults
const { titleColor, textColor, bgColor } = getCardColors({