From 5fb6acf047dfe9cdecb98998cfca6ca39e153805 Mon Sep 17 00:00:00 2001 From: discomrade Date: Fri, 15 Oct 2021 00:52:23 +0000 Subject: [PATCH] Use stored title instead of document.title in notifications Prevents number of unreads being added to notification thread name --- js/auto-reload.js | 2 +- js/mod/recent-posts-auto-reload.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/auto-reload.js b/js/auto-reload.js index 10f2f0f5..4735edc1 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -159,7 +159,7 @@ $(document).ready(function(){ } if (notify === "all" || (notify === "mention" && $(this).find('.own_post').length)) { var body = $(this).children('.body').html().replace(//gi, "\n"); - var n = new Notification("New reply to "+$('title').text(), {body: $('
').html(body).text()}); + var n = new Notification("New reply to "+ title, {body: $('
').html(body).text()}); } >>>>>>> 5e4e27bc... Make all notifications show, not just the first unread diff --git a/js/mod/recent-posts-auto-reload.js b/js/mod/recent-posts-auto-reload.js index 0e5a5f27..5ed0547e 100644 --- a/js/mod/recent-posts-auto-reload.js +++ b/js/mod/recent-posts-auto-reload.js @@ -192,7 +192,7 @@ $(document).ready(function(){ if($('#' + id).length == 0) { if (notify) { var body = $(this).children('.body').html().replace(//gi, "\n"); - var n = new Notification("New reply to "+$('title').text(), {body: $('
').html(body).text()}); + var n = new Notification("New reply to "+ title, {body: $('
').html(body).text()}); } $(this).parent().insertBefore($('.post-wrapper:first')); new_posts++;