Switch to since=ID

This commit is contained in:
Philipp Heckel
2022-02-27 19:29:17 -05:00
parent cda9dfa9d0
commit 0909354a6c
5 changed files with 9 additions and 10 deletions
+3 -3
View File
@@ -6,15 +6,15 @@ class Subscription {
this.baseUrl = baseUrl;
this.topic = topic;
this.notifications = new Map(); // notification ID -> notification object
this.last = 0;
this.last = null; // Last message ID
}
addNotification(notification) {
if (this.notifications.has(notification.id) || notification.time < this.last) {
if (this.notifications.has(notification.id)) {
return false;
}
this.notifications.set(notification.id, notification);
this.last = notification.time;
this.last = notification.id;
return true;
}