mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 03:51:26 +01:00
fixes recent topic post notification
This commit is contained in:
@@ -38,10 +38,8 @@ define(function() {
|
||||
});
|
||||
|
||||
socket.on('event:new_topic', function(data) {
|
||||
|
||||
++Recent.newTopicCount;
|
||||
Recent.updateAlertText();
|
||||
|
||||
});
|
||||
|
||||
socket.on('event:new_post', function(data) {
|
||||
@@ -61,16 +59,16 @@ define(function() {
|
||||
Recent.updateAlertText = function() {
|
||||
var text = 'There';
|
||||
|
||||
if (newTopicCount > 1) {
|
||||
text += ' are ' + newTopicCount + ' new topics';
|
||||
} else if (newTopicCount === 1) {
|
||||
if (Recent.newTopicCount > 1) {
|
||||
text += ' are ' + Recent.newTopicCount + ' new topics';
|
||||
} else if (Recent.newTopicCount === 1) {
|
||||
text += ' is a new topic';
|
||||
}
|
||||
|
||||
if (newPostCount > 1) {
|
||||
text += (newTopicCount?' and ':' are ') + newPostCount + ' new posts';
|
||||
if (Recent.newPostCount > 1) {
|
||||
text += (Recent.newTopicCount?' and ':' are ') + Recent.newPostCount + ' new posts';
|
||||
} else if(newPostCount === 1) {
|
||||
text += (newTopicCount?' and ':' is ') + ' a new post';
|
||||
text += (Recent.newTopicCount?' and ':' is ') + ' a new post';
|
||||
}
|
||||
|
||||
text += '. Click here to reload.';
|
||||
|
||||
Reference in New Issue
Block a user