|
|
@@ -1435,14 +1435,14 @@ function notifs_html5_ask_permission() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-function notifs_html5_show(nb) {
|
|
|
+function notifs_html5_show(nb, nb_new) {
|
|
|
if (notifs_html5_permission !== 'granted') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
const notification = new window.Notification(context.i18n.notif_title_articles, {
|
|
|
icon: '../themes/icons/favicon-256-padding.png',
|
|
|
- body: context.i18n.notif_body_articles.replace('%d', nb),
|
|
|
+ body: context.i18n.notif_body_new_articles.replace('%d', nb_new) + ' ' + context.i18n.notif_body_unread_articles.replace('%d', nb),
|
|
|
tag: 'freshRssNewArticles',
|
|
|
});
|
|
|
|
|
|
@@ -1482,6 +1482,8 @@ function refreshUnreads() {
|
|
|
const isAll = document.querySelector('.category.all.active');
|
|
|
let new_articles = false;
|
|
|
let nbUnreadFeeds = 0;
|
|
|
+ const title = document.querySelector('.category.all .title');
|
|
|
+ const nb_unreads_before = title ? str2int(title.getAttribute('data-unread')) : 0;
|
|
|
|
|
|
Object.keys(json.feeds).forEach(function (feed_id) {
|
|
|
const nbUnreads = json.feeds[feed_id];
|
|
|
@@ -1522,12 +1524,12 @@ function refreshUnreads() {
|
|
|
tags.querySelector('.title').setAttribute('data-unread', numberFormat(nbUnreadTags));
|
|
|
}
|
|
|
|
|
|
- const title = document.querySelector('.category.all .title');
|
|
|
const nb_unreads = title ? str2int(title.getAttribute('data-unread')) : 0;
|
|
|
|
|
|
if (nb_unreads > 0 && new_articles) {
|
|
|
faviconNbUnread(nb_unreads);
|
|
|
- notifs_html5_show(nb_unreads);
|
|
|
+ const nb_new = nb_unreads - nb_unreads_before;
|
|
|
+ notifs_html5_show(nb_unreads, nb_new);
|
|
|
}
|
|
|
};
|
|
|
req.send();
|