Fix User > Profile showing {getProgressDisplay()} - fixes #8412 (#8421)

* Fix User > Profile showing {getProgressDisplay()}

* Remove bad nextRewardAt check
This commit is contained in:
Gerardo Saca
2017-01-18 21:25:37 -08:00
committed by Keith Holliday
parent 68f4275c44
commit e395182c95

View File

@@ -93,8 +93,8 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$
$scope.getProgressDisplay = function () { $scope.getProgressDisplay = function () {
var currentLoginDay = Content.loginIncentives[$scope.profile.loginIncentives]; var currentLoginDay = Content.loginIncentives[$scope.profile.loginIncentives];
if (!currentLoginDay) return env.t('moreIncentivesComingSoon');
var nextRewardAt = currentLoginDay.nextRewardAt; var nextRewardAt = currentLoginDay.nextRewardAt;
if (!currentLoginDay || !nextRewardAt) return env.t('moreIncentivesComingSoon');
if (!currentLoginDay.prevRewardKey) currentLoginDay.prevRewardKey = 0; if (!currentLoginDay.prevRewardKey) currentLoginDay.prevRewardKey = 0;
return env.t('checkinProgressTitle') + ' ' + ($scope.profile.loginIncentives - currentLoginDay.prevRewardKey) + '/' + (nextRewardAt - currentLoginDay.prevRewardKey); return env.t('checkinProgressTitle') + ' ' + ($scope.profile.loginIncentives - currentLoginDay.prevRewardKey) + '/' + (nextRewardAt - currentLoginDay.prevRewardKey);
}; };