Skip to content

Commit

Permalink
fix: correctly show 'Post reported to Natty' message
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jun 3, 2024
1 parent 63ed3e4 commit dfce471
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/UserscriptTools/NattyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,19 @@ export class NattyAPI extends Reporter {
}

public override async sendFeedback(feedback: string): Promise<string> {
this.wasReported()
? await this.chat.sendMessage(`${this.feedbackMessage} ${feedback}`)
: await this.report(feedback);
if (this.wasReported()) {
await this.chat.sendMessage(`${this.feedbackMessage} ${feedback}`);

return this.getSentMessage(true, feedback);
return this.getSentMessage(true, feedback);
} else if (feedback === 'tp') {
return this.report();
}

return '';
}

private async report(feedback: string): Promise<string> {
// no point in reporting if the feedback is not tp
if (!this.canBeReported() || feedback !== 'tp') return '';
private async report(): Promise<string> {
if (!this.canBeReported()) return '';

// When mods flag a post as NAA/VLQ, then that
// post is deleted immediately. As a result, it
Expand Down

0 comments on commit dfce471

Please sign in to comment.