fix prevent click

This commit is contained in:
Javier 2016-04-11 11:14:49 -03:00
commit 2d8663171c
2 changed files with 5 additions and 9 deletions

View file

@ -24,7 +24,7 @@
<div class="m20b" translate>Permanently delete this wallet. THIS ACTION CANNOT BE REVERSED</div> <div class="m20b" translate>Permanently delete this wallet. THIS ACTION CANNOT BE REVERSED</div>
</div> </div>
<ul class="no-bullet m0"> <ul class="no-bullet m0">
<li ng-click="isDeletingWallet || preferences.deleteWallet()"> <li ng-click="preferences.deleteWallet()">
<div class="right" ng-style="{'color':index.backgroundColor}" ng-show="!isDeletingWallet"> <div class="right" ng-style="{'color':index.backgroundColor}" ng-show="!isDeletingWallet">
{{index.walletName}} <span ng-show="index.alias">({{index.alias}})</span> {{index.walletName}} <span ng-show="index.alias">({{index.alias}})</span>
</div> </div>

View file

@ -39,15 +39,13 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
modalInstance.result.then(function(ok) { modalInstance.result.then(function(ok) {
if (ok) { if (ok) {
$timeout(function() { _deleteWallet();
$scope.isDeletingWallet = true;
_deleteWallet();
}, 100);
} }
}); });
}; };
var _deleteWallet = function() { var _deleteWallet = function() {
$scope.isDeletingWallet = true;
var fc = profileService.focusedClient; var fc = profileService.focusedClient;
var name = fc.credentials.walletName; var name = fc.credentials.walletName;
var walletName = (fc.alias || '') + ' [' + name + ']'; var walletName = (fc.alias || '') + ' [' + name + ']';
@ -67,15 +65,13 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
}; };
this.deleteWallet = function() { this.deleteWallet = function() {
if ($scope.isDeletingWallet) return;
if (isCordova) { if (isCordova) {
navigator.notification.confirm( navigator.notification.confirm(
delete_msg, delete_msg,
function(buttonIndex) { function(buttonIndex) {
if (buttonIndex == 1) { if (buttonIndex == 1) {
$timeout(function() { _deleteWallet();
$scope.isDeletingWallet = true;
_deleteWallet();
}, 100);
} }
}, },
confirm_msg, [accept_msg, cancel_msg] confirm_msg, [accept_msg, cancel_msg]