diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index f10121ee6..52695e829 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -38,9 +38,11 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.minShapeshiftAmount = parseFloat(data.stateParams.minShapeshiftAmount); $scope.maxShapeshiftAmount = parseFloat(data.stateParams.maxShapeshiftAmount); $scope.shapeshiftOrderId = data.stateParams.shapeshiftOrderId; - $scope.fromWalletId = data.stateParams.fromWalletId; } + // To get the wallet from with the new flow + $scope.fromWalletId = data.stateParams.fromWalletId; + if (data.stateParams.noPrefix) { $scope.showWarningMessage = data.stateParams.noPrefix != 0; if ($scope.showWarningMessage) { @@ -458,7 +460,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ amount: $scope.useSendMax ? null : _amount, currency: unit.id.toUpperCase(), coin: coin, - useSendMax: $scope.useSendMax + useSendMax: $scope.useSendMax, + fromWalletId: $scope.fromWalletId }); } else { var amount = _amount; @@ -479,6 +482,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ toColor: $scope.toColor, coin: coin, useSendMax: $scope.useSendMax, + fromWalletId: $scope.fromWalletId }; if ($scope.shapeshiftOrderId) { diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 2bfbee665..99265457d 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicPopup, $ionicNavBarDelegate, clipboardService) { +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, $ionicLoading, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicPopup, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; var clipboardHasContent = false; var originalList; @@ -15,9 +15,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( if ($scope.clipboardHasAddress || $scope.clipboardHasContent) { clipboardService.readFromClipboard(function(text) { $scope.$apply(function() { - $scope.formData.search = text; + $scope.formData.search = text; + $scope.findContact($scope.formData.search); }); - $scope.findContact($scope.formData.search); }); } else { $ionicPopup.alert({ @@ -70,11 +70,13 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } $scope.walletSelectorTitleTo = gettextCatalog.getString('Send to'); } else { + $ionicLoading.show(); walletService.getAddress(wallet, true, function(err, addr) { + $ionicLoading.hide(); return $state.transitionTo('tabs.send.amount', { displayAddress: $scope.walletToWalletFrom.coin === 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, recipientType: 'wallet', - fromWalletId: $scope.walletToWalletFrom.walletId, + fromWalletId: $scope.walletToWalletFrom.id, toAddress: addr, coin: $scope.walletToWalletFrom.coin }); diff --git a/src/js/services/clipboardService.js b/src/js/services/clipboardService.js index c53a1b764..2420d45e9 100644 --- a/src/js/services/clipboardService.js +++ b/src/js/services/clipboardService.js @@ -31,10 +31,10 @@ angular.module('copayApp.services').factory('clipboardService', function ($http, },0); } else { navigator.clipboard.readText() - .then(text => { + .then(function (text) { cb(text); }) - .catch(err => { + .catch(function (err) { $log.debug("Clipboard reading is not supported in browser.."); }); diff --git a/src/js/services/incomingData.js b/src/js/services/incomingData.js index a318e1157..1bb87b49c 100644 --- a/src/js/services/incomingData.js +++ b/src/js/services/incomingData.js @@ -228,10 +228,12 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat } else if (/^https?:\/\//.test(data)) { payproService.getPayProDetails(data, coin, function(err, details) { if (err) { - root.showMenu({ - data: data, - type: 'url' - }); + if ($state.includes('tabs.scan')) { + root.showMenu({ + data: data, + type: 'url' + }); + } return; } handlePayPro(details); diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 05230af06..8b39808db 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -115,7 +115,7 @@ wallet-selector-display-balance-as-fiat="displayBalanceAsFiat"> -