summaryrefslogtreecommitdiffstats
path: root/client/components/cards/cardDetails.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-06-16 17:58:36 +0300
committerLauri Ojansivu <x@xet7.org>2020-06-16 17:58:36 +0300
commit2353f654deae2aa747a45ce4bf16a5ca91c55e34 (patch)
tree31b7129c96844ea493a38a0d9911f81382516a24 /client/components/cards/cardDetails.js
parente4de42d487b8d965276fdb7ce770cf58d562e766 (diff)
parent06b548f12ed853692db78dbbfbe7988382c0fdee (diff)
downloadwekan-2353f654deae2aa747a45ce4bf16a5ca91c55e34.tar.gz
wekan-2353f654deae2aa747a45ce4bf16a5ca91c55e34.tar.bz2
wekan-2353f654deae2aa747a45ce4bf16a5ca91c55e34.zip
Merge branch 'master' of https://github.com/NicoP-S/wekan into NicoP-S-master
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r--client/components/cards/cardDetails.js22
1 files changed, 3 insertions, 19 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 11e010d4..a91d9b6e 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -38,22 +38,6 @@ BlazeComponent.extendComponent({
Meteor.subscribe('unsaved-edits');
},
- voteState() {
- const card = this.currentData();
- const userId = Meteor.userId();
- let state;
- if (card.vote) {
- if (card.vote.positive) {
- state = _.contains(card.vote.positive, userId);
- if (state === true) return true;
- }
- if (card.vote.negative) {
- state = _.contains(card.vote.negative, userId);
- if (state === true) return false;
- }
- }
- return null;
- },
isWatching() {
const card = this.currentData();
return card.findWatcher(Meteor.userId());
@@ -412,9 +396,9 @@ BlazeComponent.extendComponent({
const forIt = $(e.target).hasClass('js-vote-positive');
let newState = null;
if (
- this.voteState() === null ||
- (this.voteState() === false && forIt) ||
- (this.voteState() === true && !forIt)
+ this.data().voteState() === null ||
+ (this.data().voteState() === false && forIt) ||
+ (this.data().voteState() === true && !forIt)
) {
newState = forIt;
}