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

Commit

Permalink
Merge branch 'development' into default-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
whilefoo authored Jul 16, 2023
2 parents 05a0c47 + b121c3b commit 7b51b34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/handlers/comment/handlers/unassign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { removeAssignees } from "../../../helpers";
import { getBotContext, getLogger } from "../../../bindings";
import { Payload } from "../../../types";
import { IssueCommentCommands } from "../commands";
import { closePullRequestForAnIssue } from "../..";

export const unassign = async (body: string) => {
const { payload: _payload } = getBotContext();
Expand All @@ -27,6 +28,7 @@ export const unassign = async (body: string) => {
logger.debug(`Unassigning sender: ${payload.sender.login.toLowerCase()}, assignee: ${assignees[0].login.toLowerCase()}, shouldUnassign: ${shouldUnassign}`);

if (shouldUnassign) {
await closePullRequestForAnIssue();
await removeAssignees(
issue_number,
assignees.map((i) => i.login)
Expand Down
7 changes: 3 additions & 4 deletions src/handlers/payout/action.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getWalletAddress, getWalletMultiplier } from "../../adapters/supabase";
import { getBotConfig, getBotContext, getLogger } from "../../bindings";
import { addLabelToIssue, deleteLabel, generatePermit2Signature, getAllIssueComments, getTokenSymbol } from "../../helpers";
import { Payload, StateReason } from "../../types";
import {UserType, Payload, StateReason } from "../../types";
import { shortenEthAddress } from "../../utils";
import { bountyInfo } from "../wildcard";

Expand Down Expand Up @@ -74,9 +74,8 @@ export const handleIssueClosed = async () => {
logger.info(`Posting a payout url to the issue, url: ${payoutUrl}`);
const comment = `### [ **[ CLAIM ${priceInEth} ${tokenSymbol.toUpperCase()} ]** ](${payoutUrl})\n` + "```" + shortenRecipient + "```";
const comments = await getAllIssueComments(issue.number);
const commentContents = comments.map((i) => i.body);
const exist = commentContents.find((content) => content.includes(comment));
if (exist) {
const permitComments = comments.filter((content) => content.body.includes("https://pay.ubq.fi?claim=") && content.user.type == UserType.Bot);
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
2 changes: 2 additions & 0 deletions src/handlers/wildcard/unassign.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { closePullRequestForAnIssue } from "..";
import { getBotConfig, getLogger } from "../../bindings";
import { GLOBAL_STRINGS } from "../../configs/strings";
import {
Expand Down Expand Up @@ -53,6 +54,7 @@ const checkBountyToUnassign = async (issue: Issue): Promise<boolean> => {
logger.info(
`Unassigning... lastActivityTime: ${lastActivity.getTime()}, curTime: ${curTimestamp}, passedDuration: ${passedDuration}, followUpTime: ${followUpTime}, disqualifyTime: ${disqualifyTime}`
);
await closePullRequestForAnIssue();
// remove assignees from the issue
await removeAssignees(issue.number, assignees);
await addCommentToIssue(`${unassignComment} \nLast activity time: ${lastActivity}`, issue.number);
Expand Down

0 comments on commit 7b51b34

Please sign in to comment.