summaryrefslogtreecommitdiffstats
path: root/client/components/cards/cardDetails.js
diff options
context:
space:
mode:
authorUnknown <unknown@example.com>2020-07-21 16:11:51 +0200
committerUnknown <unknown@example.com>2020-07-21 16:11:51 +0200
commitca8f2a70a4469c961e39354b14d41841a19ad6d7 (patch)
treea24489d015d1860fa5b6c757706d0b3aecff26f7 /client/components/cards/cardDetails.js
parent232bc746f4b2d09945fdfe68e3aa14ff6f4e79f6 (diff)
parentf6e9f5a5e8423fed9eaadaf196b46273eca241d0 (diff)
downloadwekan-ca8f2a70a4469c961e39354b14d41841a19ad6d7.tar.gz
wekan-ca8f2a70a4469c961e39354b14d41841a19ad6d7.tar.bz2
wekan-ca8f2a70a4469c961e39354b14d41841a19ad6d7.zip
Merge remote-tracking branch 'origin/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;
}