Skip to content

Commit

Permalink
fix: do not check "Leave comment" if the post has comments
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Mar 3, 2025
1 parent 0b8a2ea commit 0172888
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/AdvancedFlagging.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3455,7 +3455,7 @@
else if (text === "Delete") return this.post.canDelete(true);
return true;
}).map(([text, cacheKey]) => {
const selected = Store.config.default[cacheKey] && (text === "Leave comment" ? Boolean(comments) : true);
const selected = Store.config.default[cacheKey] && (text === "Leave comment" ? !comments : true);
const idified = text.toLowerCase().replace(" ", "-");
const id = `advanced-flagging-${idified}-checkbox-${this.post.id}`;
return {
Expand Down
2 changes: 1 addition & 1 deletion src/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class Popover {
const selected = Store.config.default[cacheKey]
// extra requirement for the leave comment option:
// there shouldn't be any comments below the post
&& (text === 'Leave comment' ? Boolean(comments) : true);
&& (text === 'Leave comment' ? !comments : true);

const idified = text.toLowerCase().replace(' ', '-');
const id = `advanced-flagging-${idified}-checkbox-${this.post.id}`;
Expand Down

0 comments on commit 0172888

Please sign in to comment.