Skip to content

Node.js based forum software built for the modern web

fixes recent topic post notification

Baris Soner Usaklic6d48f477c0e
diff --git a/public/src/forum/recent.js b/public/src/forum/recent.js
index 8e0eaeb293..10c8968417 100644
--- a/public/src/forum/recent.js
+++ b/public/src/forum/recent.js
@@ -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.';