DEV: optimize fix for sub-categories not getting pre-filled.

DEV: optimize fix for sub-categories not getting pre-filled.

diff --git a/app/assets/javascripts/discourse/routes/new-topic.js.es6 b/app/assets/javascripts/discourse/routes/new-topic.js.es6
index da9ebf7..266276f 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.get(type) === subCategory.toLowerCase() &&
+            item[type] === subCategory.toLowerCase() &&
             item.parent_category_id === main.id
           );
         });

GitHub sha: 102be5a9

2 Likes