From 7fa1cd166845477fbc1c01738a3b916a6e2aeafb Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 11:02:25 +0900 Subject: [PATCH 1/8] Fix contacts --- src/js/controllers/tab-send.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 2bfbee665..671c0a91a 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -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({ From 7459fcffd20f0951fabd90ff74fa69b733f9c236 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 13:43:47 +0900 Subject: [PATCH 2/8] 416 - Fix : Show the menu only if we are on the scan tab. --- src/js/services/incomingData.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); From 8a7aeefc1c2bfc667129a3a2441ee055c98a2fde Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 14:20:06 +0900 Subject: [PATCH 3/8] Fix multiple selections --- www/views/tab-send.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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"> - From 6e8ec0b295b845c798d4b772dbd4c9a44a7e3daa Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 14:20:45 +0900 Subject: [PATCH 4/8] Add a loading popup --- src/js/controllers/tab-send.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 671c0a91a..cdfe48657 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, ongoingProcess, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicPopup, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; var clipboardHasContent = false; var originalList; @@ -70,7 +70,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } $scope.walletSelectorTitleTo = gettextCatalog.getString('Send to'); } else { + ongoingProcess.set(null, true); walletService.getAddress(wallet, true, function(err, addr) { + ongoingProcess.set(null, false); return $state.transitionTo('tabs.send.amount', { displayAddress: $scope.walletToWalletFrom.coin === 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, recipientType: 'wallet', From b181854ca400119364858825e6496d53e96f7b45 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 14:40:43 +0900 Subject: [PATCH 5/8] 416 - ionicLoading --- src/js/controllers/tab-send.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index cdfe48657..da9414d05 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, ongoingProcess, 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; @@ -70,9 +70,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } $scope.walletSelectorTitleTo = gettextCatalog.getString('Send to'); } else { - ongoingProcess.set(null, true); + $ionicLoading.show(); walletService.getAddress(wallet, true, function(err, addr) { - ongoingProcess.set(null, false); + $ionicLoading.hide(); return $state.transitionTo('tabs.send.amount', { displayAddress: $scope.walletToWalletFrom.coin === 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, recipientType: 'wallet', From 255e3b85bb2aa5a8a27c46c06e561c45d440c90c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 16:01:37 +0900 Subject: [PATCH 6/8] Fix wallet from --- src/js/controllers/amount.js | 8 ++++++-- src/js/controllers/tab-send.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index f10121ee6..c54145947 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 || undefined }); } 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 || undefined }; if ($scope.shapeshiftOrderId) { diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index da9414d05..99265457d 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( 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 }); From 90fbf801d38dfde2e97dff2d3fa9f5fa9c64d75a Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 17 Jul 2018 19:10:33 +1200 Subject: [PATCH 7/8] Removed unnecessary logic. --- src/js/controllers/amount.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index c54145947..52695e829 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -461,7 +461,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ currency: unit.id.toUpperCase(), coin: coin, useSendMax: $scope.useSendMax, - fromWalletId: $scope.fromWalletId || undefined + fromWalletId: $scope.fromWalletId }); } else { var amount = _amount; @@ -482,7 +482,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ toColor: $scope.toColor, coin: coin, useSendMax: $scope.useSendMax, - fromWalletId: $scope.fromWalletId || undefined + fromWalletId: $scope.fromWalletId }; if ($scope.shapeshiftOrderId) { From e18e446eef72090cb2bc1693ebb074f9c66ce12b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 18:37:46 +0900 Subject: [PATCH 8/8] => Unsupported uglify --- src/js/services/clipboardService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/services/clipboardService.js b/src/js/services/clipboardService.js index ff28cd2e7..ebd30c28c 100644 --- a/src/js/services/clipboardService.js +++ b/src/js/services/clipboardService.js @@ -29,10 +29,10 @@ angular.module('copayApp.services').factory('clipboardService', function ($http, cb(nodeWebkitService.readFromClipboard()); } 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.."); });