mirror of https://github.com/pixelfed/pixelfed.git
Update ProfileFeed.vue
This commit is contained in:
parent
89b42036e5
commit
bf497ef31b
|
@ -275,6 +275,7 @@
|
||||||
v-on:likes-modal="openLikesModal(index)"
|
v-on:likes-modal="openLikesModal(index)"
|
||||||
v-on:shares-modal="openSharesModal(index)"
|
v-on:shares-modal="openSharesModal(index)"
|
||||||
v-on:comment-likes-modal="openCommentLikesModal"
|
v-on:comment-likes-modal="openCommentLikesModal"
|
||||||
|
v-on:bookmark="handleBookmark(index)"
|
||||||
v-on:handle-report="handleReport" />
|
v-on:handle-report="handleReport" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -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) {
|
formatCount(val) {
|
||||||
return App.util.format.count(val);
|
return App.util.format.count(val);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue