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

Commit f13552b

Browse files
committed
fix comparing dates
1 parent ad50ed3 commit f13552b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cstleagueorg/cs2-blog-scraper",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "",
55
"main": "dist/src/index.js",
66
"scripts": {
@@ -10,7 +10,6 @@
1010
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
1111
"lint": "eslint .",
1212
"prepare": "npm run build",
13-
"prepublishOnly": "npm test && npm run lint",
1413
"preversion": "npm run lint",
1514
"version": "npm run format && git add -A src",
1615
"postversion": "git push && git push --tags"
@@ -26,7 +25,7 @@
2625
"csgo",
2726
"node-fetch"
2827
],
29-
"author": "Ta1al",
28+
"author": "Sergey Zhirov <polarwolf@cstl.gg>",
3029
"license": "ISC",
3130
"devDependencies": {
3231
"@types/jest": "^29.2.3",

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@ export class UpdatesListener {
9292
this.callback = callback
9393
// eslint-disable-next-line @typescript-eslint/no-misused-promises
9494
this.intervalId = setInterval(this.fetchPosts, interval)
95+
void this.fetchPosts()
9596
}
9697

9798
async fetchPosts (): Promise<void> {
9899
const posts = await getPosts(undefined, this.params)
99100
posts.reverse().forEach(post => {
100-
if (post.date.getTime() > this.lastPostTime) {
101+
if (post.date.getTime() <= this.lastPostTime) {
101102
return
102103
}
103104
this.callback(post)

0 commit comments

Comments
 (0)