From bf497ef31b99fb2c350e7138e7043c5f9866317f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 5 Oct 2024 23:50:16 -0600 Subject: [PATCH] Update ProfileFeed.vue --- .../partials/profile/ProfileFeed.vue | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/resources/assets/components/partials/profile/ProfileFeed.vue b/resources/assets/components/partials/profile/ProfileFeed.vue index 3be99ce38..92dd86b9b 100644 --- a/resources/assets/components/partials/profile/ProfileFeed.vue +++ b/resources/assets/components/partials/profile/ProfileFeed.vue @@ -275,6 +275,7 @@ v-on:likes-modal="openLikesModal(index)" v-on:shares-modal="openSharesModal(index)" v-on:comment-likes-modal="openCommentLikesModal" + v-on:bookmark="handleBookmark(index)" v-on:handle-report="handleReport" /> @@ -845,6 +846,32 @@ }) }, + handleBookmark(index) { + let p = this.feed[index]; + + if(p.reblog) { + p = p.reblog; + } + + axios.post('/i/bookmark', { + item: p.id + }) + .then(res => { + if(this.feed[index].reblog) { + this.feed[index].reblog.bookmarked = !p.bookmarked; + } else { + this.feed[index].bookmarked = !p.bookmarked; + } + }) + .catch(err => { + this.$bvToast.toast('Cannot bookmark post at this time.', { + title: 'Bookmark Error', + variant: 'danger', + autoHideDelay: 5000 + }); + }); + }, + formatCount(val) { return App.util.format.count(val); },