mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
fix: iterate through repository language nodes
Just made a little oopsie I forgot to actually count the language after getting more. Iterating (`.forEach(...)`) through each repository's language nodes should fix the problem.
This commit is contained in:
parent
bb44c9c041
commit
b49ef3f705
1 changed files with 7 additions and 3 deletions
|
|
@ -85,8 +85,12 @@ export class GithubAPIClient {
|
||||||
|
|
||||||
const languages = new Set<string>();
|
const languages = new Set<string>();
|
||||||
userData.repositories.nodes.forEach((node: Repository) => {
|
userData.repositories.nodes.forEach((node: Repository) => {
|
||||||
if (node.languages.nodes[0] != undefined) {
|
if (node.languages.nodes != undefined) {
|
||||||
languages.add(node.languages.nodes[0].name);
|
node.languages.nodes.forEach((node: Language) => {
|
||||||
|
if (node != undefined) {
|
||||||
|
languages.add(node.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const durationTime = new Date().getTime() -
|
const durationTime = new Date().getTime() -
|
||||||
|
|
@ -108,7 +112,7 @@ export class GithubAPIClient {
|
||||||
languages.size,
|
languages.size,
|
||||||
durationYear,
|
durationYear,
|
||||||
ancientAccount,
|
ancientAccount,
|
||||||
joined2020
|
joined2020,
|
||||||
);
|
);
|
||||||
return userInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue