Updated shortname validation to support multiple browsers

This commit is contained in:
Keith Holliday
2016-05-22 02:20:25 +01:00
parent 0c20cf30d7
commit c9eebf0b84
4 changed files with 12 additions and 2 deletions

View File

@@ -120,6 +120,8 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
$scope.save = function(challenge) {
if (!challenge.group) return alert(window.env.t('selectGroup'));
if (!challenge.shortName || challenge.shortName.length < 3) return alert(window.env.t('shortNameTooShort'));
var isNew = !challenge._id;
if(isNew && challenge.prize > $scope.maxPrize) {