Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit e36df59

Browse files
committed
fix context issue
1 parent f13552b commit e36df59

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cstleagueorg/cs2-blog-scraper",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "",
55
"main": "dist/src/index.js",
66
"scripts": {

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class UpdatesListener {
9191
this.params = params
9292
this.callback = callback
9393
// eslint-disable-next-line @typescript-eslint/no-misused-promises
94-
this.intervalId = setInterval(this.fetchPosts, interval)
94+
this.intervalId = setInterval(this.fetchPosts.bind(this), interval)
9595
void this.fetchPosts()
9696
}
9797

@@ -101,7 +101,9 @@ export class UpdatesListener {
101101
if (post.date.getTime() <= this.lastPostTime) {
102102
return
103103
}
104-
this.callback(post)
104+
try {
105+
this.callback(post)
106+
} catch (e) {}
105107
this.lastPostTime = post.date.getTime()
106108
})
107109
}

0 commit comments

Comments
 (0)