2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: Suggested Topics was being set inside a computed property

This is bad because changing the `suggested_topics` proeprty could cause
a `set` on `suggested_topics`.
This commit is contained in:
Robin Ward 2020-11-23 15:53:48 -05:00
parent 67979b2b21
commit 0e0c70019b

View file

@ -194,12 +194,7 @@ const Topic = RestModel.extend({
@discourseComputed("suggested_topics") @discourseComputed("suggested_topics")
suggestedTopics(suggestedTopics) { suggestedTopics(suggestedTopics) {
if (suggestedTopics) { if (suggestedTopics) {
const store = this.store; return suggestedTopics.map((st) => this.store.createRecord("topic", st));
return this.set(
"suggested_topics",
suggestedTopics.map((st) => store.createRecord("topic", st))
);
} }
}, },