|
@@ -25,10 +25,13 @@
|
|
|
},
|
|
|
computed: {
|
|
|
likeable () {
|
|
|
+ let postUsername = this.post.User ?
|
|
|
+ this.post.User.username :
|
|
|
+ null
|
|
|
+
|
|
|
return (
|
|
|
this.$store.state.username &&
|
|
|
- this.post.User &&
|
|
|
- this.post.User.username !== this.$store.state.username
|
|
|
+ postUsername !== this.$store.state.username
|
|
|
)
|
|
|
},
|
|
|
likes: {
|
|
@@ -81,6 +84,13 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ //TODO: fix this subtle bug
|
|
|
+ '$store.state.username': function() {
|
|
|
+ this._liked = false
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|