Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { getOwnerWithFallback } from "discourse-common/lib/get-owner";
import I18n from "I18n";

const QUERY_PARAM_VALUES = {
Expand All @@ -16,17 +15,17 @@ const UX_VALUES = {
};

export default class SolvedStatusFilter extends Component {
static shouldRender(args, helper) {
const router = getOwnerWithFallback(this).lookup("service:router");
static shouldRender(args, context, owner) {
const router = owner.lookup("service:router");

if (
!helper.siteSettings.show_filter_by_solved_status ||
!context.siteSettings.show_filter_by_solved_status ||
router.currentRouteName === "discovery.categories" ||
args.editingCategory
) {
return false;
} else if (
helper.siteSettings.allow_solved_on_all_topics ||
context.siteSettings.allow_solved_on_all_topics ||
router.currentRouteName === "tag.show"
) {
return true;
Expand Down