I am facing an issue with my Vue code where the replies to comments are not showing in the browser until I manually refresh the page or add a new comment followed by a refresh. Even though the reply is successfully saved to the database, it does not display without a manual refresh.
In Comments.vue
My Methods
appendReply(comment,reply){
_.find(this.comments, { id: comment.id }).children.push(reply)
},
Mounted
bus.$on('comment:replied', ({ comment, reply }) => {
this.appendReply(comment, reply)
this.scrollToComment(reply)
})
Error message displayed in console
[Vue warn]: Error in event handler for "comment:replied": "TypeError: Cannot read property 'push' of undefined"