mirror of
https://github.com/nextcloud/passman.git
synced 2024-11-10 09:13:00 +08:00
Merge branch 'fix-350'
This commit is contained in:
commit
d1103e6db3
1 changed files with 36 additions and 36 deletions
|
@ -271,43 +271,43 @@
|
|||
|
||||
$scope.confirm_vault_delete = false;
|
||||
$scope.delete_vault_password = '';
|
||||
$scope.delete_vault = function () {
|
||||
if ($scope.confirm_vault_delete && $scope.delete_vault_password === VaultService.getActiveVault().vaultKey) {
|
||||
getCurrentVaultCredentials(function (vault) {
|
||||
var credentials = vault.credentials;
|
||||
$scope.remove_pw = {
|
||||
percent: 0,
|
||||
done: 0,
|
||||
total: vault.credentials.length
|
||||
};
|
||||
var deleteCredential = function(index){
|
||||
$scope.translationData = {
|
||||
password: credentials[index].label
|
||||
};
|
||||
CredentialService.destroyCredential(credentials[index].guid).then(function () {
|
||||
var percent = index / vault.credentials.length * 100;
|
||||
$scope.remove_pw = {
|
||||
percent: percent,
|
||||
done: index,
|
||||
total: vault.credentials.length
|
||||
};
|
||||
if(index === credentials.length-1){
|
||||
VaultService.deleteVault(vault).then(function () {
|
||||
SettingsService.setSetting('defaultVaultPass', false);
|
||||
SettingsService.setSetting('defaultVault', null);
|
||||
$rootScope.$broadcast('logout');
|
||||
$location.path('/');
|
||||
});
|
||||
return;
|
||||
}
|
||||
deleteCredential(index+1);
|
||||
});
|
||||
};
|
||||
deleteCredential(0);
|
||||
});
|
||||
}
|
||||
$scope.delete_vault = function() {
|
||||
if ($scope.confirm_vault_delete && $scope.delete_vault_password === VaultService.getActiveVault().vaultKey) {
|
||||
getCurrentVaultCredentials(function(vault) {
|
||||
var credentials = vault.credentials;
|
||||
$scope.remove_pw = {
|
||||
percent: 0,
|
||||
done: 0,
|
||||
total: vault.credentials.length,
|
||||
};
|
||||
var deleteCredential = function(index) {
|
||||
$scope.translationData = {
|
||||
password: credentials[index].label,
|
||||
};
|
||||
CredentialService.destroyCredential(credentials[index].guid).then(function() {
|
||||
var percent = index / vault.credentials.length * 100;
|
||||
$scope.remove_pw = {
|
||||
percent: percent,
|
||||
done: index,
|
||||
total: vault.credentials.length,
|
||||
};
|
||||
if (index === credentials.length - 1) {
|
||||
VaultService.deleteVault(vault).then(function() {
|
||||
SettingsService.setSetting('defaultVaultPass', false);
|
||||
SettingsService.setSetting('defaultVault', null);
|
||||
$rootScope.$broadcast('logout');
|
||||
$location.path('/');
|
||||
});
|
||||
return;
|
||||
}
|
||||
deleteCredential(index + 1);
|
||||
});
|
||||
};
|
||||
deleteCredential(0);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
$rootScope.$on('logout', function () {
|
||||
$scope.active_vault = null;
|
||||
|
|
Loading…
Reference in a new issue