mirror of
https://github.com/multipleof4/ntfy.git
synced 2026-10-14 23:47:55 +00:00
Poll on page refresh; validate subscribe dialog properly; avoid save-races
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user