diff --git a/controllers/story.js b/controllers/story.js index c8f1f965c4..f615c8210a 100644 --- a/controllers/story.js +++ b/controllers/story.js @@ -139,16 +139,15 @@ exports.returnIndividualStory = function(req, res, next) { var userVoted = false; try { - var votedObj = story.upVotes.filter(function(a){ - return a['upVotedByUsername'] === req.user['profile']['username']; - }) - - if (votedObj.length > 0){ - userVoted = true; - } - } catch(err){ - userVoted = false; - } + var votedObj = story.upVotes.filter(function(a){ + return a['upVotedByUsername'] === req.user['profile']['username']; + }) + if (votedObj.length > 0){ + userVoted = true; + } + } catch(err){ + userVoted = false; + } res.render('stories/index', { title: story.headline, link: story.link, diff --git a/public/js/main.js b/public/js/main.js index 5979fd88c6..e03a864b9e 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -121,7 +121,7 @@ $(document).ready(function() { var upvoteHandler = function () { $(".ion-arrow-up-b").hide(); - var _id = storyId; + var _id = storyId; $('#upvote').unbind('click'); var alreadyUpvoted = false; for (var i = 0; i < upVotes.length; i++) {