Merge pull request #3918 from cmgustavo/bug/duplicate-request-touchid-password
Fix duplicate request of password or touchid
This commit is contained in:
commit
eaff73e989
2 changed files with 21 additions and 27 deletions
|
|
@ -32,7 +32,7 @@
|
||||||
ng-click="confirm.accept(index.confirmTx.callback)"
|
ng-click="confirm.accept(index.confirmTx.callback)"
|
||||||
class="small m10b round expand"
|
class="small m10b round expand"
|
||||||
ng-style="{'background-color':index.backgroundColor}" translate>
|
ng-style="{'background-color':index.backgroundColor}" translate>
|
||||||
Accept
|
Confirm
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -923,7 +923,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$rootScope.$emit('Local/NeedsConfirmation', txp, function(accept) {
|
$rootScope.$emit('Local/NeedsConfirmation', txp, function(accept) {
|
||||||
if (accept) self.acceptTx(txp);
|
if (accept) self.confirmTx(txp);
|
||||||
else self.resetForm();
|
else self.resetForm();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -932,7 +932,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.acceptTx = function(txp) {
|
this.confirmTx = function(txp) {
|
||||||
var self = this;
|
var self = this;
|
||||||
txService.prepare(function(err) {
|
txService.prepare(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -944,35 +944,29 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
self.setOngoingProcess();
|
self.setOngoingProcess();
|
||||||
self.setSendError(err);
|
self.setSendError(err);
|
||||||
} else {
|
} else {
|
||||||
self.prepareSignAndBroadcastTx(txpPublished);
|
txService.signAndBroadcast(txpPublished, {
|
||||||
|
reporterFn: self.setOngoingProcess.bind(self)
|
||||||
|
}, function(err, txp) {
|
||||||
|
self.resetForm();
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen');
|
||||||
|
$scope.$emit('Local/TxProposalAction');
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$digest();
|
||||||
|
}, 1);
|
||||||
|
} else {
|
||||||
|
go.walletHome();
|
||||||
|
txStatus.notify(txp, function() {
|
||||||
|
$scope.$emit('Local/TxProposalAction', txp.status == 'broadcasted');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.prepareSignAndBroadcastTx = function(txp) {
|
|
||||||
var fc = profileService.focusedClient;
|
|
||||||
var self = this;
|
|
||||||
txService.prepareAndSignAndBroadcast(txp, {
|
|
||||||
reporterFn: self.setOngoingProcess.bind(self)
|
|
||||||
}, function(err, txp) {
|
|
||||||
self.resetForm();
|
|
||||||
|
|
||||||
if (err) {
|
|
||||||
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen');
|
|
||||||
$scope.$emit('Local/TxProposalAction');
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$digest();
|
|
||||||
}, 1);
|
|
||||||
} else {
|
|
||||||
go.walletHome();
|
|
||||||
txStatus.notify(txp, function() {
|
|
||||||
$scope.$emit('Local/TxProposalAction', txp.status == 'broadcasted');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setForm = function(to, amount, comment) {
|
this.setForm = function(to, amount, comment) {
|
||||||
var form = $scope.sendForm;
|
var form = $scope.sendForm;
|
||||||
if (to) {
|
if (to) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue