From dd75f581e7d068d8e0582bf6509d8e72535addca Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 10 Aug 2018 10:47:16 +0200 Subject: [PATCH 1/4] move stateParams and fromWallet outside of the clipboar function --- src/js/controllers/tab-send.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 81b3e4ca5..3f1da01fc 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -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 From 3365a61d6234c72fcfdddd0dd6e434a97ad6e59f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Fri, 10 Aug 2018 17:47:21 +0900 Subject: [PATCH 2/4] invalidate cache --- src/js/controllers/tab-home.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 9c4f2bee9..318fcece2 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -214,6 +214,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', var j = 0; lodash.each(wallets, function(wallet) { + walletService.invalidateCache(wallet); // Temporary solution, to have the good balance, when we ask to reload the wallets. walletService.getStatus(wallet, {}, function(err, status) { if (err) { From 5185c6ee3ccb579064e29c8f42ad57d3320a9904 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Fri, 10 Aug 2018 18:41:47 +0900 Subject: [PATCH 3/4] Fix amount --- src/js/directives/formattedAmount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/directives/formattedAmount.js b/src/js/directives/formattedAmount.js index 1a05fd360..9f70b37ed 100644 --- a/src/js/directives/formattedAmount.js +++ b/src/js/directives/formattedAmount.js @@ -90,7 +90,7 @@ // to both being in value. Don't want to use previous currency value. // Try to extract currency from value.. var currencySplit = $scope.value.split(" "); - if (currencySplit.length === 2) { + if (currencySplit.length === 2 && !$scope.currency) { $scope.currency = currencySplit[1]; } $scope.currency = $scope.currency || ''; From daf9bb535653cedec9f5ea1c484d10fcf42ddf2e Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Fri, 10 Aug 2018 18:43:28 +0900 Subject: [PATCH 4/4] Notify to reload home tab --- src/js/controllers/tab-receive.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 190f1b752..c822b4521 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -158,6 +158,10 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi soundService.play('misc/payment_received.mp3'); } + // Notify new tx + $scope.$emit('bwsEvent', $scope.wallet.id); + + $scope.$apply(function () { $scope.showingPaymentReceived = true; });