Skip to content
Snippets Groups Projects
Commit c65381eb authored by matograine's avatar matograine
Browse files

Do not show checklist for renewals.

The two certification functions should be reformatted and common procedures merged.
parent 412cfee8
No related branches found
No related tags found
1 merge request!638Certification : add questions before validation
......@@ -824,6 +824,20 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET')
);
// assume certification checks were done if renewal
if ( isCertificationRenewal($scope.formData.received_cert, wallet.data.pubkey) ) {
return UIUtils.alert.confirm('CONFIRM.CERTIFY_RULES', 'CONFIRM.POPUP_SECURITY_WARNING_TITLE', {
cssClass: 'warning',
okText: 'WOT.BTN_YES_CERTIFY',
okType: 'button-assertive'
})
.then( function (confirm) {
if (confirm) {
answers_are_right.resolve(true);
}
})
}
// display certification checklist modal
return Modals.showCertificationCheckList({
answers_are_right: answers_are_right,
......@@ -946,6 +960,20 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET')
);
// assume certification checks were done if renewal
if ( isCertificationRenewal(identity.received_cert, wallet.data.pubkey) ) {
return UIUtils.alert.confirm('CONFIRM.CERTIFY_RULES', 'CONFIRM.POPUP_SECURITY_WARNING_TITLE', {
cssClass: 'warning',
okText: 'WOT.BTN_YES_CERTIFY',
okType: 'button-assertive'
})
.then( function (confirm) {
if (confirm) {
answers_are_right.resolve(true);
}
})
}
// Display cert checklist modal
return Modals.showCertificationCheckList({
answers_are_right: answers_are_right,
......@@ -1588,3 +1616,9 @@ function WotSelectPubkeyIdentityModalController($scope, $q, csWot, parameters) {
};
$scope.$on('modal.shown', $scope.load);
}
function isCertificationRenewal(identity_current_certs, certifier_pubkey) {
return _.find(identity_current_certs, function(certification) {
return certification.pubkey == certifier_pubkey;
})
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment