FIX: Restore `propertyEqual` following native-class conversions (#28605)

I mistakenly replaced these with `@equal`, thinking the behavior was the same. It's not. `@propertyEqual` compares two properties, while `@equal` compares a single property with a constant.
This commit is contained in:
David Taylor 2024-08-28 16:20:16 +01:00 committed by GitHub
parent 54b281c4a2
commit 2e5502c417
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -1,9 +1,10 @@
import Component from "@ember/component";
import { action } from "@ember/object";
import { empty, equal } from "@ember/object/computed";
import { empty } from "@ember/object/computed";
import { scheduleOnce } from "@ember/runloop";
import { underscore } from "@ember/string";
import { classNameBindings, tagName } from "@ember-decorators/component";
import { propertyEqual } from "discourse/lib/computed";
import DiscourseURL from "discourse/lib/url";
import getURL from "discourse-common/lib/get-url";
import discourseComputed from "discourse-common/utils/decorators";
@ -13,7 +14,7 @@ import I18n from "discourse-i18n";
@classNameBindings("active", "tabClassName")
export default class EditCategoryTab extends Component {
@empty("params.slug") newCategory;
@equal("selectedTab", "tab") active;
@propertyEqual("selectedTab", "tab") active;
@discourseComputed("tab")
tabClassName(tab) {

View File

@ -1,6 +1,6 @@
import Component from "@ember/component";
import { equal } from "@ember/object/computed";
import { classNameBindings } from "@ember-decorators/component";
import { propertyEqual } from "discourse/lib/computed";
import { prioritizeNameInUx } from "discourse/lib/settings";
import { userPath } from "discourse/lib/url";
import getURL from "discourse-common/lib/get-url";
@ -14,7 +14,7 @@ import I18n from "discourse-i18n";
"primaryGroup"
)
export default class GroupPost extends Component {
@equal("post.post_type", "site.post_types.moderator_action")
@propertyEqual("post.post_type", "site.post_types.moderator_action")
moderatorAction;
@discourseComputed("post.url")