From 468b366145652f5a03cd7b3449ba09d015f39f6c Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 30 Aug 2015 17:10:50 -0700 Subject: [PATCH] fix # of stargazers and forks on projects --- public/js/projects.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/public/js/projects.js b/public/js/projects.js index 6e6b20b..c0db839 100644 --- a/public/js/projects.js +++ b/public/js/projects.js @@ -77,6 +77,12 @@ var d = new Date(repo.updatedAt) var updated = d.getDate() + ' ' + Months[d.getMonth()] + ', ' + d.getFullYear() text('updated', updated) + + data.set('stars', repo.stargazersCount) + updateStars(repo.stargazersCount) + + data.set('forks', repo.forksCount) + updateN('fork', repo.forksCount) }) .fetchLanguages(function(err, langs) { if (err) { @@ -94,22 +100,6 @@ updateContributors(users) } }) - .fetchWatchers(function(err, users) { - if (err) { - text('nstar', '?') - } else { - data.set('stars', users) - updateStars(users.length) - } - }) - .fetchForks(function(err, repos) { - if (err) { - text('nfork', '?') - } else { - data.set('forks', repos) - updateN('fork', repos.length) - } - }) } else { console.log('hit ' + t + ' (' + (+new Date() - t) + ')') try {