Fixed new bug where comment didn't appear on comment thread after posting
So the latest deployment introduced new bugs to otherwise working functions!
sortedComments() is a computed property, and using a variable which is the result of a mounted method won't work in computed. The variable won't be reactive. Hence when I post a comment, it won't auto refresh and show the comment. Had to stop using the method, move the forEach() and push() to asyncData instead, and add the `accounts` data into the `post.comments` array directly BEFORE it goes to computed.
I'm still not sure why it didn't work on Vue/Nuxt, just know this is the case...
sortedComments() is a computed property, and using a variable which is the result of a mounted method won't work in computed. The variable won't be reactive. Hence when I post a comment, it won't auto refresh and show the comment. Had to stop using the method, move the forEach() and push() to asyncData instead, and add the `accounts` data into the `post.comments` array directly BEFORE it goes to computed.
I'm still not sure why it didn't work on Vue/Nuxt, just know this is the case...