diff --git a/api/controllers/FlairController.js b/api/controllers/FlairController.js index c4a67000..1cfdaa8f 100644 --- a/api/controllers/FlairController.js +++ b/api/controllers/FlairController.js @@ -169,8 +169,8 @@ module.exports = { } }); - var newPFlair = _.get(req, "user.flair.ptrades.flair_css_class", "default"); - var newsvFlair = _.get(req, "user.flair.svex.flair_css_class", ""); + var newPFlair = _.get(req, "user.flair.ptrades.flair_css_class") || "default"; + var newsvFlair = _.get(req, "user.flair.svex.flair_css_class") || ""; newsvFlair = newsvFlair.replace(/2/, ""); var promises = []; promises.push(Reddit.setFlair(refreshToken, req.user.name, newPFlair, flairs.ptrades, "PokemonTrades")); diff --git a/assets/js/userCtrl.js b/assets/js/userCtrl.js index 023e15a7..8fa36915 100644 --- a/assets/js/userCtrl.js +++ b/assets/js/userCtrl.js @@ -72,7 +72,7 @@ module.exports = function ($scope, $filter, $location, UserFactory) { $scope.userok.applyFlair = false; $scope.userspin.applyFlair = true; var flair = $scope.getFlair($scope.selectedFlair, $scope.flairs); - if ($scope.selectedFlair && $scope.canUserApply($scope.user, flair, $scope.flairs)) { + if ($scope.selectedFlair && $scope.canUserApply(flair)) { io.socket.post("/flair/apply", {flair: $scope.selectedFlair, sub: flair.sub}, function (data, res) { if (res.statusCode === 200) { $scope.user.apps.push(data);