Skip to content

Node.js based forum software built for the modern web

fix unread icon

Barış Soner Uşaklıd32f5459b7b6
diff --git a/public/src/client/footer.js b/public/src/client/footer.js
index 25444f0912..8c20ead59b 100644
--- a/public/src/client/footer.js
+++ b/public/src/client/footer.js
@@ -7,7 +7,10 @@ define('forum/footer', ['notifications', 'chat', 'components', 'translator'], fu
translator.prepareDOM();
function updateUnreadTopicCount(url, count) {
- $('a[href="' + config.relative_path + url + '"] i')
+ if (!utils.isNumber(count)) {
+ return;
+ }
+ $('#header-menu a[href="' + config.relative_path + url + '"] i')
.toggleClass('unread-count', count > 0)
.attr('data-content', count > 99 ? '99+' : count);
}
@@ -35,7 +38,8 @@ define('forum/footer', ['notifications', 'chat', 'components', 'translator'], fu
function increaseUnreadCount() {
var count = parseInt($('#unread-count i').attr('data-content'), 10) + 1;
- updateUnreadTopicCount(count);
+
+ updateUnreadTopicCount('/unread', count);
}
function markTopicsUnread(tid) {