import LikeButton from './like-button.js' export default { name: 'Comments', components: { LikeButton }, props: ['messageID'], methods: { commentObjects(objects) { console.log(111111111111) console.log(objects.filter(o=>'like' in o)) console.log(objects.filter(o=>'comment' in o)) return objects.filter(o=> 'comment' in o && 'timestamp' in o && o.comment == this.messageID && typeof o.timestamp == 'number') .sort((a,b)=> objects.filter(o=> 'like' in o && o.like == a._id).length < objects.filter(o=> 'like' in o && o.like == b._id).length ) }, sendComment(objects) { this.$graffitiUpdate({ comment: this.messageID, timestamp: Date.now(), message: this.message, _tags: [this.messageID] }) } }, template: `
Comment
Collapse thread
` }