From f218a66c2dd56832d6100660c0190bb0df4dd67d Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 30 Mar 2022 13:45:47 +0000 Subject: [PATCH] use .bind instead of self=this --- src/report/ReportPoll.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/report/ReportPoll.ts b/src/report/ReportPoll.ts index 6bedce4..3829ed2 100644 --- a/src/report/ReportPoll.ts +++ b/src/report/ReportPoll.ts @@ -37,9 +37,8 @@ export class ReportPoll { ) { } private schedulePoll() { - const self = this; this.timeout = setTimeout( - function() { self.getAbuseReports() }, + this.getAbuseReports.bind(this), 60_000 // a minute in milliseconds ); }