<commit_before>'use strict';

angular.module('subutai.accountSettings.controller', [])
.controller('AccountCtrl', AccountCtrl);


AccountCtrl.$inject = ['identitySrv', '$scope', 'ngDialog', 'SweetAlert', 'cfpLoadingBar'];


function AccountCtrl(identitySrv, $scope, ngDialog, SweetAlert, cfpLoadingBar) {

	var vm = this;

	vm.message = "That's my message!";
	vm.activeUser = {publicKey: ''};

	cfpLoadingBar.start();
	angular.element(document).ready(function () {
		cfpLoadingBar.complete();
	});

	function getDelegateDocument() {
		identitySrv.getIdentityDelegateDocument().success(function(data) {
			vm.message = data;
			if (vm.message) {
				$('.bp-sign-input').addClass('bp-sign-target');
			}
		});
	}
	getDelegateDocument();

	vm.approveDocument = function () {
		LOADING_SCREEN();
		identitySrv.approveIdentityDelegate(encodeURIComponent(vm.message)).success(function() {
			SweetAlert.swal("Approved!", "Message was successfully approved.", "success");
		}).error(function(error) {
			LOADING_SCREEN('none');
			SweetAlert.swal("ERROR!", "Error: " + error, "error");
		});
	};

	vm.setPublicKey = function () {
		LOADING_SCREEN();
		identitySrv.updatePublicKey(encodeURIComponent(vm.activeUser.publicKey)).success(function(data) {
			identitySrv.createIdentityDelegateDocument().success(function() {
				getDelegateDocument();
			}).error(function(error) {
				LOADING_SCREEN('none');
				SweetAlert.swal("ERROR!", "Error: " + error, "error");
			});
		}).error(function(error) {
			LOADING_SCREEN('none');
			SweetAlert.swal("ERROR!", "Error: " + error, "error");
		});
	};

	identitySrv.getCurrentUser().success(function (data) {
		vm.activeUser = data;
		identitySrv.getKey(vm.activeUser.securityKeyId).success(function (key) {
			vm.activeUser.publicKey = key;
		});<commit_msg>approve load screen fix<commit_after>'use strict';

angular.module('subutai.accountSettings.controller', [])
.controller('AccountCtrl', AccountCtrl);


AccountCtrl.$inject = ['identitySrv', '$scope', 'ngDialog', 'SweetAlert', 'cfpLoadingBar'];


function AccountCtrl(identitySrv, $scope, ngDialog, SweetAlert, cfpLoadingBar) {

	var vm = this;

	vm.message = "That's my message!";
	vm.activeUser = {publicKey: ''};

	cfpLoadingBar.start();
	angular.element(document).ready(function () {
		cfpLoadingBar.complete();
	});

	function getDelegateDocument() {
		identitySrv.getIdentityDelegateDocument().success(function(data) {
			vm.message = data;
			if (vm.message) {
				$('.bp-sign-input').addClass('bp-sign-target');
			}
		});
	}
	getDelegateDocument();

	vm.approveDocument = function () {
		LOADING_SCREEN();
		identitySrv.approveIdentityDelegate(encodeURIComponent(vm.message)).success(function() {
			LOADING_SCREEN('none');
			SweetAlert.swal("Approved!", "Message was successfully approved.", "success");
		}).error(function(error) {
			LOADING_SCREEN('none');
			SweetAlert.swal("ERROR!", "Error: " + error, "error");
		});
	};

	vm.setPublicKey = function () {
		LOADING_SCREEN();
		identitySrv.updatePublicKey(encodeURIComponent(vm.activeUser.publicKey)).success(function(data) {
			identitySrv.createIdentityDelegateDocument().success(function() {
				getDelegateDocument();
			}).error(function(error) {
				LOADING_SCREEN('none');
				SweetAlert.swal("ERROR!", "Error: " + error, "error");
			});
		}).error(function(error) {
			LOADING_SCREEN('none');
			SweetAlert.swal("ERROR!", "Error: " + error, "error");
		});
	};

	identitySrv.getCurrentUser().success(function (data) {
		vm.activeUser = data;
		identitySrv.getKey(vm.activeUser.securityKeyId).success(function (key) {
			vm.activeUser.publicKey = key;
		});
{'fraction_non_alphanumeric': 0.17572413793103447, 'fraction_numerical': 0.0, 'mean_word_length': 5.406360424028269, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3319675', 'n_tokens_mistral': 1289, 'n_tokens_neox': 1179, 'n_words': 164}