diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index 80967df8c358f320615d22b3bd7eceaefdec1dc1..e79a6ba6dd19436ef9bcdffd3d6bdda6f2a12b80 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -757,6 +757,8 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ return; } + /* MATOGRAINE FROM HERE WE CAN GROUP IN ONE CERTIFY FUNCTION */ + // Check identity not expired if ($scope.formData.requirements.expired) { UIUtils.alert.error('ERROR.IDENTITY_EXPIRED'); @@ -764,7 +766,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ } // Check not already certified - var previousCert = _.find($scope.formData.received_cert, function(cert) { + var previousCert = _.find($scope.formData.received_cert, function(cert) { // MATOGRAINE "cert" here is an element from received certs list. return cert.pubkey === wallet.data.pubkey && cert.valid && cert.expiresIn > csSettings.data.timeWarningExpire; }); if (previousCert) { @@ -893,11 +895,13 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ .then(function (identity) { if (!identity) return; // cancelled UIUtils.loading.hide(); - if (!identity || !identity.hasSelf) { + if (!identity || !identity.hasSelf) { // MATOGRAINE (!identity) is no need to be tested here, it is tested above. UIUtils.alert.error('ERROR.IDENTITY_TO_CERTIFY_HAS_NO_SELF'); return; } + /* MATOGRAINE FROM HERE WE CAN GROUP IN ONE CERTIFY FUNCTION */ + // Check identity not expired if (identity.requirements.expired) { UIUtils.alert.error('ERROR.IDENTITY_EXPIRED');