aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/CommentVoter.vue8
-rw-r--r--src/components/UploadVoter.vue2
-rw-r--r--src/pages/UploadDetail.vue2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/components/CommentVoter.vue b/src/components/CommentVoter.vue
index 6f2ce0d..9ab9e72 100644
--- a/src/components/CommentVoter.vue
+++ b/src/components/CommentVoter.vue
@@ -7,9 +7,9 @@
</i>
{{ comment.voting.sum }}
</span>
- <span v-if="comment.author.username !== $store.state.user.decodedToken.username && !myVote">
- <q-btn color="negative" round small icon="fa-thumbs-down" @click="vote(-1)"></q-btn>
- <q-btn color="positive" round small icon="fa-thumbs-up" @click="vote(1)"></q-btn>
+ <span v-if="!myVote">
+ <q-btn color="negative" round size="sm" flat icon="fa-thumbs-down" @click="vote(-1)"></q-btn>
+ <q-btn color="positive" round size="sm" flat icon="fa-thumbs-up" @click="vote(1)"></q-btn>
</span>
<span v-if="myVote">You voted <i :class="`fas fa-thumbs-${myVote.impact === 1 ? 'up text-positive' : 'down text-negative'}`"></i></span>
</div>
@@ -49,7 +49,7 @@
methods: {
vote (impact) {
let that = this
- this.$http.post(`/comments/${this.comment.upload}/comments/${this.comment._id}/vote`, {impact: impact}).then(response => that.$emit('voted'))
+ this.$http.post(`/uploads/${this.comment.upload}/comments/${this.comment._id}/vote`, {impact: impact}).then(response => that.$emit('voted'))
},
},
}
diff --git a/src/components/UploadVoter.vue b/src/components/UploadVoter.vue
index 563bc79..031cd82 100644
--- a/src/components/UploadVoter.vue
+++ b/src/components/UploadVoter.vue
@@ -7,7 +7,7 @@
</i>
{{ upload.voting.sum }}
</h5>
- <span v-if="upload.author.username !== $store.state.user.decodedToken.username && !myVote">
+ <span v-if="!myVote">
<q-btn color="negative" round small icon="fa-thumbs-down" @click="vote(-1)"></q-btn>
<q-btn color="positive" round small icon="fa-thumbs-up" @click="vote(1)"></q-btn>
</span>
diff --git a/src/pages/UploadDetail.vue b/src/pages/UploadDetail.vue
index 9b6f73a..86abcec 100644
--- a/src/pages/UploadDetail.vue
+++ b/src/pages/UploadDetail.vue
@@ -51,7 +51,7 @@
:name="(comment.author || {}).username"
:text="comment.body.split('\n').filter(el => el.trim() !== '')"
:stamp="$moment(comment.createdAt).format('LLLL')" />
- <comment-voter :comment="comment"></comment-voter>
+ <comment-voter @voted="loadComments" :comment="comment"></comment-voter>
</div>
<div>
<q-input