Skip to content

Node.js based forum software built for the modern web

https://github.com/NodeBB/nodebb-plugin-composer-default/issues/24

barisusaklif61d0cb45722
diff --git a/public/src/app.js b/public/src/app.js
index 791aabd628..a4acd0468b 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -455,26 +455,9 @@ app.cacheBuster = null;
};
app.newTopic = function (cid) {
- cid = cid || ajaxify.data.cid;
- if (cid) {
- $(window).trigger('action:composer.topic.new', {
- cid: cid
- });
- } else {
- socket.emit('categories.getCategoriesByPrivilege', 'topics:create', function(err, categories) {
- if (err) {
- return app.alertError(err.message);
- }
- categories = categories.filter(function(category) {
- return !category.link && !parseInt(category.parentCid, 10);
- });
- if (categories.length) {
- $(window).trigger('action:composer.topic.new', {
- cid: categories[0].cid
- });
- }
- });
- }
+ $(window).trigger('action:composer.topic.new', {
+ cid: cid || ajaxify.data.cid || 0
+ });
};
app.loadJQueryUI = function(callback) {
@@ -546,5 +529,5 @@ app.cacheBuster = null;
linkEl.href = config.relative_path + '/js-enabled.css';
document.head.appendChild(linkEl);
- }
+ };
}());