Merge branch 'navigateAwayWarning'

This commit is contained in:
brantje 2016-10-15 16:51:40 +02:00
commit 8b31278429
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
2 changed files with 22 additions and 0 deletions

View file

@ -156,6 +156,18 @@
$scope.cur_state = {};
$scope.$on("$locationChangeStart", function(event) {
if($scope.change_pw){
if($scope.change_pw.total > 0 && $scope.change_pw.done < $scope.change_pw.total){
if(!confirm("Are you sure you want to leave?\nThis will corrupt all your credentials")){
event.preventDefault();
}
}
}
});
$scope.changeVaultPassword = function (oldVaultPass, newVaultPass, newVaultPass2) {
if (oldVaultPass !== VaultService.getActiveVault().vaultKey) {
$scope.error = 'Your old password is incorrect!';

View file

@ -240,6 +240,15 @@
};
$scope.$on("$locationChangeStart", function(event) {
if(!sharing_complete){
if(!confirm("Are you sure you want to leave?\nThis will corrupt this credential")){
event.preventDefault();
}
}
});
$scope.sharing_complete = true;
$scope.applyShare = function () {
$scope.sharing_complete = false;
@ -284,6 +293,7 @@
}
}
NotificationService.showNotification('Saved!', 4000);
$scope.sharing_complete = true;
} else {
ShareService.generateSharedKey(20).then(function (key) {