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

Parse Permit Url #738

Merged
merged 6 commits into from
Sep 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/handlers/payout/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,14 @@ export const handleIssueClosed = async () => {
logger.info(`Posting a payout url to the issue, url: ${payoutUrl}`);
const comment =
`#### Task Assignee Reward\n### [ **[ CLAIM ${priceInEth} ${tokenSymbol.toUpperCase()} ]** ](${payoutUrl})\n` + "```" + shortenRecipient + "```";
const permitComments = comments.filter((content) => content.body.includes("https://pay.ubq.fi?claim=") && content.user.type == UserType.Bot);
const permitComments = comments.filter((content) => {
0xcodercrane marked this conversation as resolved.
Show resolved Hide resolved
if (content.body.includes("https://pay.ubq.fi") && content.user.type == UserType.Bot) {
Sadaf-A marked this conversation as resolved.
Show resolved Hide resolved
const url = new URL(content.body);
// Check if the URL contains the specific query parameter
return url.searchParams.has("claim");
}
return false;
});
if (permitComments.length > 0) {
logger.info(`Skip to generate a permit url because it has been already posted`);
return `Permit generation skipped because it was already posted to this issue.`;
Expand Down