fix(plugins/people): duplicate sponsors when using plugin_people_sponsors_custom (#959) [skip ci]
This commit is contained in:
@@ -85,8 +85,12 @@ export default async function({login, data, graphql, rest, q, queries, imports,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Special type handling
|
//Special type handling
|
||||||
if (types.includes("sponsorshipsCustom"))
|
if (types.includes("sponsorshipsCustom")) {
|
||||||
types.splice(types.indexOf("sponsorshipsCustom"), 1)
|
types.splice(types.indexOf("sponsorshipsCustom"), 1)
|
||||||
|
const unique = [...new Map(result.sponsorshipsAsMaintainer.reverse().map(user => [user.login, user])).values()].reverse()
|
||||||
|
data.user.sponsorshipsAsMaintainer.totalCount -= result.sponsorshipsAsMaintainer.length - unique.length
|
||||||
|
result.sponsorshipsAsMaintainer = unique
|
||||||
|
}
|
||||||
|
|
||||||
//Results
|
//Results
|
||||||
return {types, size, ...result}
|
return {types, size, ...result}
|
||||||
|
|||||||
Reference in New Issue
Block a user