move stateParams and fromWallet outside of the clipboar function

This commit is contained in:
Sebastiaan Pasma 2018-08-10 10:47:16 +02:00
commit dd75f581e7
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F

View file

@ -28,14 +28,15 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
};
$scope.$on("$ionicView.enter", function(event, data) {
var stateParams = sendFlowService.getState();
$scope.fromWallet = profileService.getWallet(stateParams.fromWalletId);
clipboardService.readFromClipboard(function(text) {
if (text.length > 200) {
text = text.substring(0, 200);
}
var stateParams = sendFlowService.getState();
$scope.fromWallet = profileService.getWallet(stateParams.fromWalletId);
$scope.clipboardHasAddress = false;
$scope.clipboardHasContent = false;
if ((text.indexOf('bitcoincash:') === 0 || text[0] === 'C' || text[0] === 'H' || text[0] === 'p' || text[0] === 'q') && text.replace('bitcoincash:', '').length === 42) { // CashAddr