@@ -90,6 +94,11 @@
'event:new_topic'
]);
+ if (jQuery('.category-item').length == 0) {
+ jQuery('.category.row').hide();
+ jQuery('#category-no-topics').show();
+ }
+
socket.on('event:new_topic', function(data) {
var html = templates.prepare(templates['category'].blocks['topics']).parse({ topics: [data] }),
topic = document.createElement('div'),
diff --git a/src/topics.js b/src/topics.js
index f5f9a3dd5f..65d1129f5f 100644
--- a/src/topics.js
+++ b/src/topics.js
@@ -72,17 +72,18 @@ marked.setOptions({
callback(false);
return;
}
+
+ active_usernames = replies[1];
+ var topics = [];
+
if (tids.length == 0) {
callback({
'category_name' : category_id ? category_name : 'Recent',
'show_topic_button' : category_id ? 'show' : 'hidden',
'category_id': category_id || 0,
- 'topics': topics
+ 'topics' : []
});
}
-
- active_usernames = replies[1];
- var topics = [];
title = replies[2];
uid = replies[3];