fixes recent topic post notification

v1.18.x
Baris Soner Usakli 11 years ago
parent 14e68bc9e2
commit c6d48f477c

@ -38,10 +38,8 @@ define(function() {
}); });
socket.on('event:new_topic', function(data) { socket.on('event:new_topic', function(data) {
++Recent.newTopicCount; ++Recent.newTopicCount;
Recent.updateAlertText(); Recent.updateAlertText();
}); });
socket.on('event:new_post', function(data) { socket.on('event:new_post', function(data) {
@ -61,16 +59,16 @@ define(function() {
Recent.updateAlertText = function() { Recent.updateAlertText = function() {
var text = 'There'; var text = 'There';
if (newTopicCount > 1) { if (Recent.newTopicCount > 1) {
text += ' are ' + newTopicCount + ' new topics'; text += ' are ' + Recent.newTopicCount + ' new topics';
} else if (newTopicCount === 1) { } else if (Recent.newTopicCount === 1) {
text += ' is a new topic'; text += ' is a new topic';
} }
if (newPostCount > 1) { if (Recent.newPostCount > 1) {
text += (newTopicCount?' and ':' are ') + newPostCount + ' new posts'; text += (Recent.newTopicCount?' and ':' are ') + Recent.newPostCount + ' new posts';
} else if(newPostCount === 1) { } else if(newPostCount === 1) {
text += (newTopicCount?' and ':' is ') + ' a new post'; text += (Recent.newTopicCount?' and ':' is ') + ' a new post';
} }
text += '. Click here to reload.'; text += '. Click here to reload.';

Loading…
Cancel
Save