From d32f5459b7b65576de3d9001785b5559567049dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 2 Aug 2017 19:44:35 -0400 Subject: [PATCH] fix unread icon --- public/src/client/footer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) {