diff --git a/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.hbs b/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.hbs index 334a2a3..5ea4e20 100644 --- a/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.hbs +++ b/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.hbs @@ -3,7 +3,7 @@ class="solved-status-filter" content=statuses value=status - valueAttribute="value" - onSelect=(action "changeStatus") + valueProperty="value" + onChange=(action "changeStatus") }} {{/if}} diff --git a/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.js.es6 b/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.js.es6 index 64542e5..6db3556 100644 --- a/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.js.es6 +++ b/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.js.es6 @@ -1,17 +1,22 @@ import I18n from "I18n"; import DiscourseUrl from "discourse/lib/url"; +import { getOwner } from "discourse-common/lib/get-owner"; export default { shouldRender(args, component) { - if (!component.siteSettings.show_filter_by_solved_status) { + const router = getOwner(this).lookup("router:main"); + + if ( + !component.siteSettings.show_filter_by_solved_status || + router.currentPath === "discovery.categories" + ) { return false; } else if (component.siteSettings.allow_solved_on_all_topics) { return true; } else { - const controller = Discourse.__container__.lookup( + const controller = getOwner(this).lookup( "controller:navigation/category" ); - return controller && controller.get("category.enable_accepted_answers"); } },