FIX: replaces discourseComputed by computed (#16530)
This was causing unexpected behaviors on production builds. And also on firefox on local environnement, however the issues was slightly different. - production chrome: colors don't load - dev firefox: colors don't change when selecting a different color set
This commit is contained in:
parent
fc56bd36c9
commit
3daa45deaf
|
@ -1,18 +1,19 @@
|
||||||
import Controller from "@ember/controller";
|
import Controller from "@ember/controller";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import bootbox from "bootbox";
|
import bootbox from "bootbox";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
|
||||||
import { later } from "@ember/runloop";
|
import { later } from "@ember/runloop";
|
||||||
import { action } from "@ember/object";
|
import { action, computed } from "@ember/object";
|
||||||
import { clipboardCopy } from "discourse/lib/utilities";
|
import { clipboardCopy } from "discourse/lib/utilities";
|
||||||
|
|
||||||
export default class AdminCustomizeColorsShowController extends Controller {
|
export default class AdminCustomizeColorsShowController extends Controller {
|
||||||
@discourseComputed("model.colors", "onlyOverridden")
|
onlyOverridden = false;
|
||||||
colors(allColors, onlyOverridden) {
|
|
||||||
if (onlyOverridden) {
|
@computed("model.colors.[]", "onlyOverridden")
|
||||||
return allColors.filterBy("overridden");
|
get colors() {
|
||||||
|
if (this.onlyOverridden) {
|
||||||
|
return this.model.colors?.filterBy("overridden");
|
||||||
} else {
|
} else {
|
||||||
return allColors;
|
return this.model.colors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue