FIX: Setting bookmarks in some cases was broken (#15120)

Error introduced in #14781

```
Error: Assertion Failed: You attempted to update <(unknown):ember3217>.bookmarks to "<(unknown):ember3846>", but it is being tracked by a tracking context, such as a template, computed property, or observer. In order to make sure the context updates properly, you must invalidate the property when updating it. You can mark the property as `@tracked`, or use `@ember/object#set` to do this.
```
This commit is contained in:
Jarek Radosz 2021-11-28 23:34:51 +01:00 committed by GitHub
parent e464958333
commit 13aed6fe3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -493,7 +493,10 @@ const Topic = RestModel.extend({
keys.forEach((key) => this.set(key, json[key]));
if (this.bookmarks.length) {
this.bookmarks = this.bookmarks.map((bm) => Bookmark.create(bm));
this.set(
"bookmarks",
this.bookmarks.map((bm) => Bookmark.create(bm))
);
}
return this;