FIX: Bookmark auto delete preference usage and default value (#19707)

This commit fixes an issue where the chat message bookmarks
did not respect the user's `bookmark_auto_delete_preference`
which they select in their user preference page.

Also, it changes the default for that value to "keep bookmark and clear reminder"
rather than "never", which ends up leaving a lot of expired bookmark
reminders around which are a pain to clean up.
This commit is contained in:
Martin Brennan
2023-01-05 08:43:58 +10:00
committed by GitHub
parent 1174a94867
commit 16b9165630
9 changed files with 175 additions and 77 deletions
@@ -723,11 +723,7 @@ export default Component.extend({
toggleBookmark() {
return openBookmarkModal(
this.message.bookmark ||
Bookmark.create({
bookmarkable_type: "ChatMessage",
bookmarkable_id: this.message.id,
user_id: this.currentUser.id,
}),
Bookmark.createFor(this.currentUser, "ChatMessage", this.message.id),
{
onAfterSave: (savedData) => {
const bookmark = Bookmark.create(savedData);