export default { props: ['messageID', 'parent'], methods: { likeObjects(objects, messageID=this.messageID) { return objects.filter(o=> 'like' in o && 'timestamp' in o && o.like == messageID && typeof o.timestamp == 'number') }, toggleLike(objects) { const myLikes = this.likeObjects(objects).mine if (myLikes.length) { myLikes.removeMine() } else { this.$graffitiUpdate({ like: this.messageID, timestamp: Date.now(), _tags: [this.messageID, this.parent] }) } } }, template: ` ` }