mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-11 07:00:51 +01:00
only init unread topics for loggedin users
dont call isFollowed
This commit is contained in:
@@ -58,15 +58,17 @@ define('forum/footer', [
|
||||
var unreadUnrepliedTopicCount = parseInt($('a[href="' + config.relative_path + '/unread?filter=unreplied"].navigation-link i').attr('data-content'), 10) + 1;
|
||||
updateUnreadTopicCount('/unread?filter=unreplied', unreadUnrepliedTopicCount);
|
||||
}
|
||||
socket.emit('topics.isFollowed', post.topic.tid, function (err, isFollowed) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
if (isFollowed) {
|
||||
var unreadWatchedTopicCount = parseInt($('a[href="' + config.relative_path + '/unread?filter=watched"].navigation-link i').attr('data-content'), 10) + 1;
|
||||
updateUnreadTopicCount('/unread?filter=watched', unreadWatchedTopicCount);
|
||||
}
|
||||
});
|
||||
if ($('a[href="' + config.relative_path + '/unread?filter=watched"].navigation-link i').length) {
|
||||
socket.emit('topics.isFollowed', post.topic.tid, function (err, isFollowed) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
if (isFollowed) {
|
||||
var unreadWatchedTopicCount = parseInt($('a[href="' + config.relative_path + '/unread?filter=watched"].navigation-link i').attr('data-content'), 10) + 1;
|
||||
updateUnreadTopicCount('/unread?filter=watched', unreadWatchedTopicCount);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function markTopicsUnread(tid) {
|
||||
@@ -96,5 +98,7 @@ define('forum/footer', [
|
||||
socket.on('event:unread.updateCount', updateUnreadCounters);
|
||||
socket.on('event:unread.updateChatCount', updateUnreadChatCount);
|
||||
|
||||
initUnreadTopics();
|
||||
if (app.user.uid > 0) {
|
||||
initUnreadTopics();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user