Node.js based forum software built for the modern web
added comments to explain the voting logic
Julian Lam86a697960696
diff --git a/src/favourites.js b/src/favourites.jsindex 4f5ff90274..0673626f51 100644--- a/src/favourites.js+++ b/src/favourites.js@@ -183,11 +183,11 @@ var async = require('async'),hook,current = voteStatus.upvoted ? 'upvote' : 'downvote';- if (voteStatus.upvoted && command === 'downvote' || voteStatus.downvoted && command === 'upvote') {+ if (voteStatus.upvoted && command === 'downvote' || voteStatus.downvoted && command === 'upvote') { // e.g. User *has* upvoted, and clicks downvotehook = command;- } else if (voteStatus.upvoted || voteStatus.downvoted) {+ } else if (voteStatus.upvoted || voteStatus.downvoted) { // e.g. User *has* upvotes, clicks upvote (so we "unvote")hook = 'unvote';- } else {+ } else { // e.g. User *has not* voted, clicks upvotehook = command;current = 'unvote';}