diff --git a/frappe/public/js/frappe/social/components/Post.vue b/frappe/public/js/frappe/social/components/Post.vue index ae3f2fd143..df964fb3a1 100644 --- a/frappe/public/js/frappe/social/components/Post.vue +++ b/frappe/public/js/frappe/social/components/Post.vue @@ -7,12 +7,15 @@
{ this.replies.push(post); }) + frappe.realtime.on('toggle_pin' + this.post.name, (is_pinned) => { + this.post.is_pinned = cint(is_pinned); + }) frappe.realtime.on('update_liked_by' + this.post.name, this.update_liked_by) }, methods: { @@ -91,6 +98,9 @@ const Post = { frappe.xcall('frappe.social.doctype.post.post.toggle_like', { post_name: this.post.name, }) + }, + toggle_pin() { + frappe.db.set_value('Post', this.post.name, 'is_pinned', cint(!this.post.is_pinned)) } } } diff --git a/frappe/public/js/frappe/social/components/PostAction.vue b/frappe/public/js/frappe/social/components/PostAction.vue index 8b7a37d3e9..877a085ba3 100644 --- a/frappe/public/js/frappe/social/components/PostAction.vue +++ b/frappe/public/js/frappe/social/components/PostAction.vue @@ -1,5 +1,8 @@