Skip to content

Commit

Permalink
fix: the capping message is not displayed if there is no task reward
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Dec 11, 2024
1 parent 0241176 commit 28d3b88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser/github-comment-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ export class GithubCommentModule extends BaseModule {
const rewardsSum =
result.comments?.reduce<Decimal>((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0)) ??
new Decimal(0);
const isCapped = rewardsSum.gt(taskReward);
// The task reward can be 0 if either there is no pricing tag or if there is no assignee
const isCapped = taskReward > 0 && rewardsSum.gt(taskReward);

return `
<details>
Expand Down

0 comments on commit 28d3b88

Please sign in to comment.