FIX: sub-categories was not getting selected for pre-filled topics

FIX: sub-categories was not getting selected for pre-filled topics

diff --git a/app/assets/javascripts/discourse/routes/new-topic.js.es6 b/app/assets/javascripts/discourse/routes/new-topic.js.es6
index c3c3c06..da9ebf7 100644
--- a/app/assets/javascripts/discourse/routes/new-topic.js.es6
+++ b/app/assets/javascripts/discourse/routes/new-topic.js.es6
@@ -84,7 +84,7 @@ export default Discourse.Route.extend({
         category = categories.find(item => {
           return (
             item &&
-            item.type === subCategory.toLowerCase() &&
+            item.get(type) === subCategory.toLowerCase() &&
             item.parent_category_id === main.id
           );
         });

GitHub sha: 48b9e0d7

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there:

Wait… why do we need this? @jjaffeux ?

We don’t. The initial state is wrong and so is the fix.

Should be: item[type]

2 Likes
3 Likes