Merge pull request #1908 from isocolsky/delete_profile

Delete profile
This commit is contained in:
Matias Alejo Garcia 2014-12-02 03:15:05 -03:00
commit b3c3af5277
5 changed files with 147 additions and 0 deletions

View file

@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
$scope.isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
$rootScope.title = 'Profile';
$scope.hideAdv = true;
$scope.downloadProfileBackup = function() {
backupService.profileDownload($rootScope.iden);
@ -53,4 +54,17 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
});
};
$scope.deleteProfile = function () {
identityService.deleteProfile(function (err, res) {
if (err) {
log.warn(err);
notification.error('Error', 'Could not delete profile');
return;
}
$location.path('/');
setTimeout(function () {
notification.error('Success', 'Profile successfully deleted');
}, 1);
});
};
});