FIX: Rename all instances of bookmarkWithReminder to just bookmark (#9579)

* Rename all instances of bookmarkWithReminder and bookmark_with_reminder to just bookmark
* Delete old bookmark code at the same time
* Add migration to remove the bookmarkWithReminder post menu item if people have it set in site settings
This commit is contained in:
Martin Brennan
2020-04-30 10:09:22 +10:00
committed by GitHub
parent 4f5ed8e781
commit ca539fdccf
13 changed files with 55 additions and 134 deletions

View File

@ -14,19 +14,19 @@ function initialize(api) {
});
api.modifyClass("model:post", {
toggleBookmarkWithReminder() {
toggleBookmark() {
// if we are talking to discobot then any bookmarks should just
// be created without reminder options, to streamline the new user
// narrative.
const discobotUserId = -2;
if (this.user_id === discobotUserId && !this.bookmarked_with_reminder) {
if (this.user_id === discobotUserId && !this.bookmarked) {
return ajax("/bookmarks", {
type: "POST",
data: { post_id: this.id }
}).then(response => {
this.setProperties({
"topic.bookmarked": true,
bookmarked_with_reminder: true,
bookmarked: true,
bookmark_id: response.id
});
this.appEvents.trigger("post-stream:refresh", { id: this.id });