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

reformat : create a method to choose which confirmation modal to show

parent 103b753a
No related branches found
No related tags found
1 merge request!638Certification : add questions before validation
...@@ -792,16 +792,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ ...@@ -792,16 +792,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET') UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET')
); );
// assume certification checks were done if renewal return $scope.displayConfirmationModalOrLicenseQuestions($scope.formData, wallet, answers_are_right )
renewal = isCertificationRenewal($scope.formData.received_cert, wallet.data.pubkey);
if ( renewal ) {
return $scope.certRenewalConfirmationModal(answers_are_right)
}
// display certification checklist modal
return Modals.showCertificationCheckList({
answers_are_right: answers_are_right,
identity: $scope.formData,
});
}) })
.catch(function(err) { .catch(function(err) {
...@@ -858,6 +849,18 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ ...@@ -858,6 +849,18 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
return true; return true;
} }
$scope.displayConfirmationModalOrLicenseQuestions = function (certified_idty, sender_wallet, answers_are_right) {
if (isCertificationRenewal(certified_idty.received_cert, sender_wallet.data.pubkey)) {
return $scope.certRenewalConfirmationModal(answers_are_right)
}
return Modals.showCertificationCheckList({
answers_are_right: answers_are_right,
identity: certified_idty,
});
}
$scope.certRenewalConfirmationModal = function (answers_are_right) { $scope.certRenewalConfirmationModal = function (answers_are_right) {
return UIUtils.alert.confirm('CONFIRM.CERTIFY_RULES', 'CONFIRM.POPUP_SECURITY_WARNING_TITLE', { return UIUtils.alert.confirm('CONFIRM.CERTIFY_RULES', 'CONFIRM.POPUP_SECURITY_WARNING_TITLE', {
cssClass: 'warning', cssClass: 'warning',
...@@ -947,16 +950,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ ...@@ -947,16 +950,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET') UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET')
); );
// assume certification checks were done if renewal return $scope.displayConfirmationModalOrLicenseQuestions(identity, wallet, answers_are_right )
renewal = isCertificationRenewal(identity.received_cert, wallet.data.pubkey);
if ( renewal ) {
return $scope.certRenewalConfirmationModal(answers_are_right)
}
// Display cert checklist modal
return Modals.showCertificationCheckList({
answers_are_right: answers_are_right,
identity: identity,
});
}) })
.catch(function (err) { .catch(function (err) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment