Skip to content

Commit

Permalink
fix: allow user to VtD, but not flag
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored May 27, 2024
1 parent 1b75224 commit b5d669a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,19 @@ export class Popover {
} catch (error) {
displayToaster('Failed to flag: ' + (error as string), 'danger');
}
}

// delete vote if the user has chosen to flag the post
// as spam/rude/NAA/VLQ
if (del && this.post.canDelete
&& reportType !== FlagNames.Plagiarism
&& reportType !== FlagNames.ModFlag
) {
try {
await this.post.deleteVote();
} catch (error) {
displayToaster('Failed to vote to delete: ' + (error as string), 'danger');
}
// delete vote if the user has chosen to flag the post
// as spam/rude/NAA/VLQ
if (del && this.post.canDelete
&& reportType !== FlagNames.Plagiarism
&& reportType !== FlagNames.ModFlag
&& reportType !== FlagNames.NoFlag
) {
try {
await this.post.deleteVote();
} catch (error) {
displayToaster('Failed to vote to delete: ' + (error as string), 'danger');
}
}
}
Expand Down

0 comments on commit b5d669a

Please sign in to comment.