Poll on page refresh; validate subscribe dialog properly; avoid save-races

This commit is contained in:
Philipp Heckel
2022-02-26 11:45:39 -05:00
parent aa79fe2861
commit e422c2c479
10 changed files with 96 additions and 37 deletions
+6 -2
View File
@@ -11,11 +11,11 @@ class Subscription {
addNotification(notification) {
if (this.notifications.has(notification.id) || notification.time < this.last) {
return this;
return false;
}
this.notifications.set(notification.id, notification);
this.last = notification.time;
return this;
return true;
}
addNotifications(notifications) {
@@ -39,6 +39,10 @@ class Subscription {
return Array.from(this.notifications.values());
}
url() {
return topicUrl(this.baseUrl, this.topic);
}
shortUrl() {
return topicShortUrl(this.baseUrl, this.topic);
}