diff --git a/app/assets/javascripts/discourse/templates/components/bread-crumbs.hbs b/app/assets/javascripts/discourse/templates/components/bread-crumbs.hbs
index ce6613330e1..e46d6c32e15 100644
--- a/app/assets/javascripts/discourse/templates/components/bread-crumbs.hbs
+++ b/app/assets/javascripts/discourse/templates/components/bread-crumbs.hbs
@@ -7,7 +7,7 @@
category=secondCategory
parentCategory=firstCategory
categories=childCategories
- subCategory="true"
+ subCategory=true
noSubcategories=noSubcategories}}
{{/if}}
diff --git a/app/assets/javascripts/select-kit/components/category-drop.js.es6 b/app/assets/javascripts/select-kit/components/category-drop.js.es6
index f9c1f9a6f83..d88fa7ff588 100644
--- a/app/assets/javascripts/select-kit/components/category-drop.js.es6
+++ b/app/assets/javascripts/select-kit/components/category-drop.js.es6
@@ -20,6 +20,7 @@ export default ComboBoxComponent.extend({
fullWidthOnMobile: true,
caretDownIcon: "caret-right",
caretUpIcon: "caret-down",
+ subCategory: false,
init() {
this._super();
@@ -50,11 +51,7 @@ export default ComboBoxComponent.extend({
collectionHeader(allCategoriesUrl, allCategoriesLabel, noCategoriesUrl, noCategoriesLabel) {
let shortcuts = "";
- const currentRoute = Ember.getOwner(this)
- .lookup("controller:application")
- .get("currentRouteName");
-
- if (currentRoute !== "discovery.parentCategory") {
+ if (this.get("hasSelection") || (this.get("noSubcategories") && this.get("subCategory"))) {
shortcuts += `
${allCategoriesLabel}
@@ -62,7 +59,7 @@ export default ComboBoxComponent.extend({
`;
}
- if (this.get("subCategory") && currentRoute !== "discovery.categoryNone") {
+ if (this.get("subCategory") && (this.get("hasSelection") || !this.get("noSubcategories"))) {
shortcuts += `
${noCategoriesLabel}
diff --git a/app/assets/javascripts/select-kit/components/tag-drop.js.es6 b/app/assets/javascripts/select-kit/components/tag-drop.js.es6
index ba23945bcc7..e5082277474 100644
--- a/app/assets/javascripts/select-kit/components/tag-drop.js.es6
+++ b/app/assets/javascripts/select-kit/components/tag-drop.js.es6
@@ -79,10 +79,6 @@ export default ComboBoxComponent.extend({
collectionHeader(allTagsUrl, allTagsLabel, noTagsUrl, noTagsLabel) {
let content = "";
- const currentRoute = Ember.getOwner(this)
- .lookup("controller:application")
- .get("currentRouteName");
-
if (this.get("tagId") !== "none") {
content += `
@@ -91,7 +87,7 @@ export default ComboBoxComponent.extend({
`;
}
- if (currentRoute === "tags.showCategory") {
+ if (this.get("hasSelection") || this.get("tagId") === "none") {
content += `
${allTagsLabel}