fix: bug where wakatime api returns undefined languages (#1403)

Co-authored-by: Markus Tyrkkö <markus.tyrkko@nitor.com>
This commit is contained in:
Markus TyrkköandMarkus Tyrkkö authored and GitHub committed 2021-11-05 19:49:51 +05:30
1 parent bc6c22ea17
commit 28fa0b8877
2 files changed
+10 -2

No files matched your search

+2 -2
View File
@@ -123,7 +123,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
} = options;
const shouldHideLangs = Array.isArray(hide) && hide.length > 0;
if (shouldHideLangs) {
if (shouldHideLangs && languages !== undefined) {
const languagesToHide = new Set(hide.map((lang) => lowercaseTrim(lang)));
languages = languages.filter(
(lang) => !languagesToHide.has(lowercaseTrim(lang.name)),
@@ -138,7 +138,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
const lheight = parseInt(line_height, 10);
langsCount = clampValue(parseInt(langs_count), 1, langs_count);
const langsCount = clampValue(parseInt(langs_count), 1, langs_count);
// returns theme based colors with proper overrides and defaults
const {