Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
feat: skip payment generation for unregistered wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
wannacfuture committed Jan 29, 2024
1 parent ec9cf21 commit 7b88ed9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/handlers/issue/generate-permits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ async function generateComment(totals: TotalsById, issue: GitHubIssue, config: B
if (error) throw error;

const beneficiaryAddress = data.length > 0 ? data[0].wallets.address : null;
if(!beneficiaryAddress) continue;

const permit = beneficiaryAddress ? await generatePermit2Signature({
const permit = await generatePermit2Signature({
beneficiary: beneficiaryAddress,
amount: tokenAmount,
userId: userId,
config,
}) : null;
});

permits.push(permit);

const html = generateHtml({
permit: permit ? permit.url : null,
permit: permit.url,
tokenAmount,
tokenSymbol,
contributorName,
Expand All @@ -82,13 +83,12 @@ function generateHtml({
<b
><h3>
<a
href="${permit ? permit.toString() : '#'}"
href="${permit.toString()}"
>
[ ${tokenAmount} ${tokenSymbol} ]</a
>
</h3>
<h6>@${contributorName}</h6>
<h5>${!permit ? ' Wallet not provided.' : '' }</h5></b
<h6>@${contributorName}</h6></b
>
</summary>
${contributionsOverviewTable}
Expand Down Expand Up @@ -242,7 +242,7 @@ function zeroToHyphen(value: number | Decimal) {
}

interface GenerateHtmlParams {
permit: URL | null;
permit: URL;
tokenAmount: Decimal;
tokenSymbol: string;
contributorName: string;
Expand Down

0 comments on commit 7b88ed9

Please sign in to comment.