Fix improved bookmark toggling/deleting bug

* i was incorrectly toggling the transformed post property
  instead of the actual property in the emberjs post model
  which broke the bookmark/unbookmark functionality
This commit is contained in:
Martin Brennan 2019-12-11 15:48:27 +10:00
parent 6261339da9
commit 232eb685af
1 changed files with 4 additions and 4 deletions

View File

@ -338,8 +338,8 @@ const Post = RestModel.extend({
}, },
toggleBookmarkWithReminder() { toggleBookmarkWithReminder() {
this.toggleProperty("bookmarkedWithReminder"); this.toggleProperty("bookmarked_with_reminder");
if (this.bookmarkedWithReminder) { if (this.bookmarked_with_reminder) {
let controller = showModal("bookmark", { let controller = showModal("bookmark", {
model: { model: {
postId: this.id postId: this.id
@ -349,7 +349,7 @@ const Post = RestModel.extend({
}); });
controller.setProperties({ controller.setProperties({
onCloseWithoutSaving: () => { onCloseWithoutSaving: () => {
this.toggleProperty("bookmarkedWithReminder"); this.toggleProperty("bookmarked_with_reminder");
this.appEvents.trigger("post-stream:refresh", { id: this.id }); this.appEvents.trigger("post-stream:refresh", { id: this.id });
} }
}); });
@ -357,7 +357,7 @@ const Post = RestModel.extend({
return Post.destroyBookmark(this.id) return Post.destroyBookmark(this.id)
.then(() => this.appEvents.trigger("page:bookmark-post-toggled", this)) .then(() => this.appEvents.trigger("page:bookmark-post-toggled", this))
.catch(error => { .catch(error => {
this.toggleProperty("bookmarkedWithReminder"); this.toggleProperty("bookmarked_with_reminder");
throw new Error(error); throw new Error(error);
}); });
} }