Skip to content

Commit 0172888

Browse files
authored
fix: do not check "Leave comment" if the post has comments
1 parent 0b8a2ea commit 0172888

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/AdvancedFlagging.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3455,7 +3455,7 @@
34553455
else if (text === "Delete") return this.post.canDelete(true);
34563456
return true;
34573457
}).map(([text, cacheKey]) => {
3458-
const selected = Store.config.default[cacheKey] && (text === "Leave comment" ? Boolean(comments) : true);
3458+
const selected = Store.config.default[cacheKey] && (text === "Leave comment" ? !comments : true);
34593459
const idified = text.toLowerCase().replace(" ", "-");
34603460
const id = `advanced-flagging-${idified}-checkbox-${this.post.id}`;
34613461
return {

src/popover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class Popover {
167167
const selected = Store.config.default[cacheKey]
168168
// extra requirement for the leave comment option:
169169
// there shouldn't be any comments below the post
170-
&& (text === 'Leave comment' ? Boolean(comments) : true);
170+
&& (text === 'Leave comment' ? !comments : true);
171171

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

0 commit comments

Comments
 (0)