From 1513f61522954115031b23f9592bdad70d4fbfe4 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Sun, 7 Mar 2021 20:57:28 +0100 Subject: [PATCH] Fix duplicated contributors (#254) --- site/src/lib/fetchAllContributors.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/src/lib/fetchAllContributors.ts b/site/src/lib/fetchAllContributors.ts index 27ad1b4..d90d928 100644 --- a/site/src/lib/fetchAllContributors.ts +++ b/site/src/lib/fetchAllContributors.ts @@ -53,7 +53,8 @@ export const filterCommits = (commits) => .map(({ sha, author, commit }) => ({ author: author && author.login ? author.login : null, commit: sha, - })); + })) + .filter(({ author }, index, self) => self.findIndex((commit) => commit.author === author) === index); const getIconHash = async (icon) => await getContentHashOfFile(path.join(process.cwd(), "../icons", `${icon}.svg`)) const iconCacheDir = path.join(process.cwd(),'.next/cache/github-api');