mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: add protection when removing auto delete on post bookmarks
If you reply to a topic and are looking at an admin page (like site settings) ,you have no postStream or posts.
This commit is contained in:
parent
c7f1777ac9
commit
04a3b949a4
@ -189,17 +189,19 @@ export default Controller.extend(bufferedProperty("model"), {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_removeDeleteOnOwnerReplyBookmarks() {
|
_removeDeleteOnOwnerReplyBookmarks() {
|
||||||
let posts = this.model.get("postStream").posts;
|
const posts = this.get("model.postStream.posts");
|
||||||
posts
|
if (posts) {
|
||||||
.filter(
|
posts
|
||||||
p =>
|
.filter(
|
||||||
p.bookmarked &&
|
p =>
|
||||||
p.bookmark_auto_delete_preference ===
|
p.bookmarked &&
|
||||||
AUTO_DELETE_PREFERENCES.ON_OWNER_REPLY
|
p.bookmark_auto_delete_preference ===
|
||||||
)
|
AUTO_DELETE_PREFERENCES.ON_OWNER_REPLY
|
||||||
.forEach(p => {
|
)
|
||||||
p.clearBookmark();
|
.forEach(p => {
|
||||||
});
|
p.clearBookmark();
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_forceRefreshPostStream() {
|
_forceRefreshPostStream() {
|
||||||
|
Loading…
Reference in New Issue
Block a user