mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: uses get() on properties of groups/badges which could be POJOs (#10682)
This commit is contained in:
parent
02dec8c209
commit
28cd1aaf8e
@ -4,7 +4,7 @@ import I18n from "I18n";
|
||||
import { A } from "@ember/array";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { gt, equal, or } from "@ember/object/computed";
|
||||
import EmberObject, { computed, getProperties } from "@ember/object";
|
||||
import EmberObject, { get, computed, getProperties } from "@ember/object";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { url } from "discourse/lib/computed";
|
||||
import RestModel from "discourse/models/rest";
|
||||
@ -859,14 +859,14 @@ const User = RestModel.extend({
|
||||
let titles = [];
|
||||
|
||||
(this.groups || []).forEach((group) => {
|
||||
if (group.get("title")) {
|
||||
titles.push(group.get("title"));
|
||||
if (get(group, "title")) {
|
||||
titles.push(get(group, "title"));
|
||||
}
|
||||
});
|
||||
|
||||
(this.badges || []).forEach((badge) => {
|
||||
if (badge.get("allow_title")) {
|
||||
titles.push(badge.get("name"));
|
||||
if (get(badge, "allow_title")) {
|
||||
titles.push(get(badge, "name"));
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user