mirror of
https://github.com/discourse/discourse-solved.git
synced 2025-02-17 17:14:58 +00:00
FIX: Correct getOwner import (#260)
As it's currently implemented, the fallback is essential here. `this` in a static method is `undefined`, and therefore cannot have an owner. Unfortunately this plugin outlet does not seem to be tested in the plugin's own test suite. Core's test suite picked up this issue. Followup to 3a0b46da7aa48e27e51c74e90b42c2083d89b4d5
This commit is contained in:
parent
3a0b46da7a
commit
56d936be63
@ -1,5 +1,5 @@
|
||||
import I18n from "I18n";
|
||||
import { getOwner } from "@ember/application";
|
||||
import { getOwnerWithFallback } from "discourse-common/lib/get-owner";
|
||||
import Component from "@glimmer/component";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
@ -17,7 +17,7 @@ const UX_VALUES = {
|
||||
|
||||
export default class SolvedStatusFilter extends Component {
|
||||
static shouldRender(args, helper) {
|
||||
const router = getOwner(this).lookup("service:router");
|
||||
const router = getOwnerWithFallback(this).lookup("service:router");
|
||||
|
||||
if (
|
||||
!helper.siteSettings.show_filter_by_solved_status ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user