Skip to content
Permalink
Browse files

FIX: update `Site.top_tags` in "categories" route if topic list avail…

…able.

Else it is not updating the tags dropdown while navigate between the category pages.
  • Loading branch information
vinothkannans committed Feb 14, 2020
1 parent 157dcc7 commit 38dd184a16f38fed1f011eeb39de580a301b8f4e
Showing with 9 additions and 0 deletions.
  1. +9 −0 app/assets/javascripts/discourse/routes/discovery-categories.js.es6
@@ -10,6 +10,7 @@ import { ajax } from "discourse/lib/ajax";
import PreloadStore from "preload-store";
import { searchPriorities } from "discourse/components/concerns/category-search-priorities";
import { hash } from "rsvp";
import Site from "discourse/models/site";

const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
renderTemplate() {
@@ -51,6 +52,10 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
wrappedCategoriesList && wrappedCategoriesList.category_list;

if (categoriesList && topicsList) {
if (topicsList.topic_list && topicsList.topic_list.top_tags) {
Site.currentProp("top_tags", topicsList.topic_list.top_tags);
}

return EmberObject.create({
categories: CategoryList.categoriesFrom(
this.store,
@@ -66,6 +71,10 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
}
// Otherwise, return the ajax result
return ajax(`/categories_and_${filter}`).then(result => {
if (result.topic_list && result.topic_list.top_tags) {
Site.currentProp("top_tags", result.topic_list.top_tags);
}

return EmberObject.create({
categories: CategoryList.categoriesFrom(this.store, result),
topics: TopicList.topicsFrom(this.store, result),

1 comment on commit 38dd184

@discoursebot

This comment has been minimized.

Copy link

discoursebot commented on 38dd184 Feb 14, 2020

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

https://meta.discourse.org/t/tag-filter-bug-all-tags-not-showing/116410/11

Please sign in to comment.
You can’t perform that action at this time.