From 39c7ee701921517cc939cfcd2f9f56ef8033f553 Mon Sep 17 00:00:00 2001 From: Amin Jalal Date: Fri, 8 Nov 2024 10:58:13 +0300 Subject: [PATCH] Fixed contributions count. --- website/scripts/contributor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/scripts/contributor.js b/website/scripts/contributor.js index e874e95..fd6e528 100644 --- a/website/scripts/contributor.js +++ b/website/scripts/contributor.js @@ -15,11 +15,11 @@ async function fetchData() { } // Render stats -function renderStats(repoStats, contributorsCount) { +function renderStats(repoStats, contributers) { const statsGrid = document.getElementById('statsGrid'); const stats = [ - { label: 'Contributors', value: contributorsCount, icon: 'users' }, - { label: 'Total Contributions', value: repoStats.contributors?.reduce((sum, contributor) => sum + contributor.contributions, 0) || 0, icon: 'git-commit' }, + { label: 'Contributors', value: contributers?.length, icon: 'users' }, + { label: 'Total Contributions', value: contributers?.reduce((sum, contributor) => sum + contributor.contributions, 0) || 0, icon: 'git-commit' }, { label: 'GitHub Stars', value: repoStats.stargazers_count || 0, icon: 'star' }, { label: 'Forks', value: repoStats.forks_count || 0, icon: 'git-branch' } ]; @@ -76,7 +76,7 @@ async function init() { const { contributors, repoStats } = await fetchData(); - renderStats(repoStats, contributors.length); + renderStats(repoStats, contributors); renderContributors(contributors); loading.style.display = 'none';