diff --git a/src/social-card/highlight-card/highlight-card.service.ts b/src/social-card/highlight-card/highlight-card.service.ts index d2f42f1..f6584ea 100644 --- a/src/social-card/highlight-card/highlight-card.service.ts +++ b/src/social-card/highlight-card/highlight-card.service.ts @@ -51,10 +51,12 @@ export class HighlightCardService { ); const [highlight, highlightReactions] = await Promise.all([highlightReq, reactionsReq]); + const { login, updated_at, url, highlight: body } = highlight.data; const [owner, repoName] = url.replace("https://github.com/", "").split("/"); const repo = await this.githubService.getRepo(owner, repoName); + const reactions = highlightReactions.data.reduce((acc, curr) => acc + Number(curr.reaction_count), 0); const langList = repo.languages?.edges?.flatMap(edge => { @@ -127,11 +129,11 @@ export class HighlightCardService { if (code === "emoji") { // if segment is an emoji // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - return (`data:image/svg+xml;base64,${btoa(await loadEmoji( "twemoji", getIconCode(segment)))}`); + return `data:image/svg+xml;base64,${btoa(await loadEmoji("twemoji", getIconCode(segment)))}`; } // if segment is normal text - return (code); + return code; }, }); diff --git a/src/social-card/templates/shared/card-footer.ts b/src/social-card/templates/shared/card-footer.ts index dff5c71..9120fda 100644 --- a/src/social-card/templates/shared/card-footer.ts +++ b/src/social-card/templates/shared/card-footer.ts @@ -14,7 +14,7 @@ const cardFooter = (langs: string, repos: string, reactions?: number) => ` reactions ? ` - ${reactions} Reactions + ${reactions} ${reactions > 1 ? "Reactions" : "Reaction"} ` : "" }