Skip to content

Commit

Permalink
fix: don't show empty popover if no feedback is to be sent
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jun 14, 2024
1 parent 3033394 commit 3af0dfe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ export async function addProgress(
flagType: CachedFlag,
post = new Page(true).posts[0]
): Promise<void> {
if (!post.filterReporters(flagType.feedbacks).length) return;
const input = document.querySelector<HTMLInputElement>('#advanced-flagging-flag-post');

if (!post.filterReporters(flagType.feedbacks).length && !input?.checked) return;

event.preventDefault();
event.stopPropagation();
Expand All @@ -199,7 +201,6 @@ export async function addProgress(
post.progress = new Progress(target);
post.progress.attach();

const input = document.querySelector<HTMLInputElement>('#advanced-flagging-flag-post');
if (input?.checked) {
const flagProgress = post.progress.addItem('Flagging as NAA...');

Expand Down

0 comments on commit 3af0dfe

Please sign in to comment.