From ae266e397b1f1f13fdec218b8df8ec7468b4c731 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 20 Sep 2016 12:02:45 -0300 Subject: [PATCH 01/13] wip --- public/views/includes/walletActivity.html | 50 +++++++++---------- public/views/modals/tx-details.html | 6 +-- public/views/tab-home.html | 4 +- src/js/controllers/modals/txDetails.js | 59 ++++++++++++++++------- src/js/controllers/tab-home.js | 18 ++++++- src/js/services/profileService.js | 10 ++-- 6 files changed, 93 insertions(+), 54 deletions(-) diff --git a/public/views/includes/walletActivity.html b/public/views/includes/walletActivity.html index ed0f57e07..0e9fceb76 100644 --- a/public/views/includes/walletActivity.html +++ b/public/views/includes/walletActivity.html @@ -1,65 +1,65 @@ -
- Copayer joined +
+ Copayer joined
-
+
Wallet created
-
+
Payment Sent
- {{x.amountStr}} + {{notification.amountStr}}
-
+
Payment Received
- {{x.amountStr}} + {{notification.amountStr}}
-
- Proposal Deleted: - {{x.message}} +
+ Proposal Deleted: + {{notification.message}}
- {{x.amountStr}}: + {{notification.amountStr}}:
-
+
Proposal Rejected: - {{x.message}} + {{notification.message}}
- {{x.amountStr}}: + {{notification.amountStr}}:
- + New Proposal: - {{x.message}} + {{notification.message}}
- {{x.amountStr}} + {{notification.amountStr}}
- + Proposal Accepted: - {{x.message}} + {{notification.message}}
- {{x.amountStr}} + {{notification.amountStr}}

- - - {{ x.creatorName}}@ - {{x.wallet.name}} - + + + {{ notification.creatorName}}@ + {{notification.wallet.name}} +

diff --git a/public/views/modals/tx-details.html b/public/views/modals/tx-details.html index d7145f679..a0f3571c8 100644 --- a/public/views/modals/tx-details.html +++ b/public/views/modals/tx-details.html @@ -9,11 +9,11 @@ -
+
- - + +
diff --git a/public/views/tab-home.html b/public/views/tab-home.html index 60849ecf8..7be004eab 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -35,7 +35,7 @@
-
+ diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js index 2324ac4b9..b6c2f3f32 100644 --- a/src/js/controllers/modals/txDetails.js +++ b/src/js/controllers/modals/txDetails.js @@ -1,28 +1,54 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { +angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, walletService, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { var self = $scope.self; - var wallet = profileService.getWallet($stateParams.walletId); + var wallet = profileService.getWallet($stateParams.walletId || $scope.walletId); var config = configService.getSync(); var configWallet = config.wallet; var walletSettings = configWallet.settings; $scope.init = function() { - $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; - $scope.color = wallet.color; - $scope.copayerId = wallet.credentials.copayerId; - $scope.isShared = wallet.credentials.n > 1; + findTx($scope.txid, function(err, tx) { + if (err) { + $log.error(err); + return; + } + console.log('TX FOUND', tx); + $scope.btx = lodash.cloneDeep(tx); + $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; + $scope.color = wallet.color; + $scope.copayerId = wallet.credentials.copayerId; + $scope.isShared = wallet.credentials.n > 1; + // $scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName; + // $scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName; + $scope.btx.feeLevel = walletSettings.feeLevel; - $scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName; - $scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName; - $scope.btx.feeLevel = walletSettings.feeLevel; + if ($scope.btx.action != 'invalid') { + if ($scope.btx.action == 'sent') $scope.title = gettextCatalog.getString('Sent Funds'); + if ($scope.btx.action == 'received') $scope.title = gettextCatalog.getString('Received Funds'); + if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved Funds'); + } - if ($scope.btx.action != 'invalid') { - if ($scope.btx.action == 'sent') $scope.title = gettextCatalog.getString('Sent Funds'); - if ($scope.btx.action == 'received') $scope.title = gettextCatalog.getString('Received Funds'); - if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved Funds'); - } - initActionList(); + initActionList(); + getAlternativeAmount(); + + $timeout(function() { + $scope.$apply(); + }, 10); + }); + }; + + function findTx(txid, cb) { + walletService.getTxHistory(wallet, {}, function(err, txHistory) { + if (err) return cb(err); + + var tx = lodash.find(txHistory, { + txid: txid + }); + + if (tx) return cb(null, tx); + else return cb(); + }); }; function initActionList() { @@ -90,7 +116,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio }); }; - $scope.getAlternativeAmount = function() { + var getAlternativeAmount = function() { var satToBtc = 1 / 100000000; wallet.getFiatRate({ @@ -123,5 +149,4 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio $scope.cancel = function() { $scope.txDetailsModal.hide(); }; - }); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 2ed46ed6d..0efcbaddf 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('tabHomeController', - function($rootScope, $timeout, $scope, $state, $stateParams, $ionicScrollDelegate, lodash, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window) { + function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, lodash, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window) { $scope.externalServices = {}; $scope.bitpayCardEnabled = true; // TODO $scope.openTxpModal = txpModalService.open; @@ -16,6 +16,18 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp; }); + $scope.openTxModal = function(n) { + console.log(n); + $scope.txid = n.txid; + $scope.walletId = n.walletId; + $ionicModal.fromTemplateUrl('views/modals/tx-details.html', { + scope: $scope + }).then(function(modal) { + $scope.txDetailsModal = modal; + $scope.txDetailsModal.show(); + }); + }; + $scope.openWallet = function(wallet) { if (!wallet.isComplete()) { return $state.go('tabs.copayers', { @@ -112,7 +124,9 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.hideHomeTip = function() { $scope.homeTip = null; $state.transitionTo($state.current, null, { - reload: false, inherit: false, notify: false + reload: false, + inherit: false, + notify: false }); }; diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index d3a81e915..c6bc0d3d0 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -822,11 +822,11 @@ angular.module('copayApp.services') x.action = function() { // TODO? - $state.go('tabs.details', { - walletId: x.walletId, - txpId: x.txpId, - txid: x.txid, - }); + // $state.go('tabs.details', { + // walletId: x.walletId, + // txpId: x.txpId, + // txid: x.txid, + // }); }; }); From 64b879fcd3fa4801cc291f650495dd006c9f1c14 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 20 Sep 2016 13:56:54 -0300 Subject: [PATCH 02/13] open tx modal from home --- public/views/modals/tx-details.html | 54 +++++++++++++++----------- src/js/controllers/modals/txDetails.js | 27 +++++++++---- src/js/controllers/tab-home.js | 1 - src/js/services/onGoingProcess.js | 1 + 4 files changed, 52 insertions(+), 31 deletions(-) diff --git a/public/views/modals/tx-details.html b/public/views/modals/tx-details.html index a0f3571c8..79e7f5be9 100644 --- a/public/views/modals/tx-details.html +++ b/public/views/modals/tx-details.html @@ -1,5 +1,5 @@ - + @@ -9,10 +9,10 @@ -
+
- + @@ -30,30 +30,30 @@
-
- Sent from {{wallet.credentials.walletName}} -
- -
+
+ Sent from {{wallet.credentials.walletName}} +
+
+
-
-
- -
- Received Funds +
+
+
+ Received Funds +
-
- Moved Funds -
+
+ Moved Funds +
-
-
+
@@ -75,14 +75,22 @@
-
Created by
- {{btx.creatorName}} - - - +
+ Date + + + +
+
+
Created by
+ {{btx.creatorName}} + + + +
-
+
Fee
{{btx.feeLevel}} ({{btx.feeStr}}) diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js index b6c2f3f32..b7c142edb 100644 --- a/src/js/controllers/modals/txDetails.js +++ b/src/js/controllers/modals/txDetails.js @@ -1,26 +1,37 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, walletService, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { +angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, ongoingProcess, walletService, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { var self = $scope.self; var wallet = profileService.getWallet($stateParams.walletId || $scope.walletId); var config = configService.getSync(); var configWallet = config.wallet; var walletSettings = configWallet.settings; + $scope.title = gettextCatalog.getString('Transaction'); + $scope.loadingTxInfo = false; $scope.init = function() { + $scope.loadingTxInfo = true; + ongoingProcess.set('loadingTxInfo', true); findTx($scope.txid, function(err, tx) { + ongoingProcess.set('loadingTxInfo', false); + $scope.loadingTxInfo = false; if (err) { $log.error(err); - return; + popupService.showAlert(gettextCatalog.getString('Error'), err); + return $scope.cancel(); } - console.log('TX FOUND', tx); + + if (!tx) { + $log.warn('No tx found'); + popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); + return $scope.cancel(); + } + $scope.btx = lodash.cloneDeep(tx); $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; $scope.color = wallet.color; $scope.copayerId = wallet.credentials.copayerId; $scope.isShared = wallet.credentials.n > 1; - // $scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName; - // $scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName; $scope.btx.feeLevel = walletSettings.feeLevel; if ($scope.btx.action != 'invalid') { @@ -46,8 +57,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio txid: txid }); - if (tx) return cb(null, tx); - else return cb(); + return cb(null, tx); }); }; @@ -148,5 +158,8 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio $scope.cancel = function() { $scope.txDetailsModal.hide(); + $timeout(function() { + $scope.txDetailsModal.remove(); + }, 10); }; }); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 0efcbaddf..605c67ee3 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -17,7 +17,6 @@ angular.module('copayApp.controllers').controller('tabHomeController', }); $scope.openTxModal = function(n) { - console.log(n); $scope.txid = n.txid; $scope.walletId = n.walletId; $ionicModal.fromTemplateUrl('views/modals/tx-details.html', { diff --git a/src/js/services/onGoingProcess.js b/src/js/services/onGoingProcess.js index be1d5ee70..642051951 100644 --- a/src/js/services/onGoingProcess.js +++ b/src/js/services/onGoingProcess.js @@ -32,6 +32,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti 'sweepingWallet': gettext('Sweeping Wallet...'), 'validatingWallet': gettext('Validating wallet integrity...'), 'validatingWords': gettext('Validating recovery phrase...'), + 'loadingTxInfo': gettext('Loading transaction info...'), }; root.clear = function() { From 1cfd4c733f87213751ca40380079693d84d74ea0 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 20 Sep 2016 16:21:05 -0300 Subject: [PATCH 03/13] refactor call tx modal --- public/views/activity.html | 2 +- public/views/modals/tx-details.html | 4 +- public/views/tab-home.html | 2 +- src/js/controllers/activity.js | 33 ++++++++++-- src/js/controllers/modals/txDetails.js | 69 +++++++------------------- src/js/controllers/tab-home.js | 33 +++++++++--- src/js/controllers/walletDetails.js | 9 +--- src/js/services/walletService.js | 11 ++++ 8 files changed, 88 insertions(+), 75 deletions(-) diff --git a/public/views/activity.html b/public/views/activity.html index 8a1738373..c020fa25f 100644 --- a/public/views/activity.html +++ b/public/views/activity.html @@ -19,7 +19,7 @@
-
+
diff --git a/public/views/modals/tx-details.html b/public/views/modals/tx-details.html index 79e7f5be9..e1e2c3640 100644 --- a/public/views/modals/tx-details.html +++ b/public/views/modals/tx-details.html @@ -9,7 +9,7 @@ -
+
@@ -53,7 +53,7 @@
-
+
diff --git a/public/views/tab-home.html b/public/views/tab-home.html index 7be004eab..c870f2088 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -30,7 +30,7 @@ {{txpsN}} - +
diff --git a/src/js/controllers/activity.js b/src/js/controllers/activity.js index 6205357c5..a55eb40f0 100644 --- a/src/js/controllers/activity.js +++ b/src/js/controllers/activity.js @@ -1,10 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('activityController', - function($rootScope, $timeout, $scope, $state, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo) { - var self = this; - - + function($timeout, $scope, $log, $ionicModal, lodash, profileService, walletService, ongoingProcess, popupService, gettextCatalog) { $scope.init = function() { $scope.fetchingNotifications = true; profileService.getNotifications(50, function(err, n) { @@ -19,4 +16,32 @@ angular.module('copayApp.controllers').controller('activityController', }, 1); }); } + + $scope.openTxModal = function(n) { + var wallet = profileService.getWallet(n.walletId); + + ongoingProcess.set('loadingTxInfo', true); + walletService.getTx(wallet, n.txid, function(err, tx) { + ongoingProcess.set('loadingTxInfo', false); + + if (err) { + $log.error(err); + return popupService.showAlert(gettextCatalog.getString('Error'), err); + } + + if (!tx) { + $log.warn('No tx found'); + return popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); + } + + $scope.wallet = wallet; + $scope.btx = lodash.cloneDeep(tx); + $ionicModal.fromTemplateUrl('views/modals/tx-details.html', { + scope: $scope + }).then(function(modal) { + $scope.txDetailsModal = modal; + $scope.txDetailsModal.show(); + }); + }); + }; }); diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js index b7c142edb..dcd14c962 100644 --- a/src/js/controllers/modals/txDetails.js +++ b/src/js/controllers/modals/txDetails.js @@ -1,64 +1,32 @@ 'use strict'; angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, ongoingProcess, walletService, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { - var self = $scope.self; - var wallet = profileService.getWallet($stateParams.walletId || $scope.walletId); var config = configService.getSync(); var configWallet = config.wallet; var walletSettings = configWallet.settings; + var wallet; $scope.title = gettextCatalog.getString('Transaction'); - $scope.loadingTxInfo = false; $scope.init = function() { - $scope.loadingTxInfo = true; - ongoingProcess.set('loadingTxInfo', true); - findTx($scope.txid, function(err, tx) { - ongoingProcess.set('loadingTxInfo', false); - $scope.loadingTxInfo = false; - if (err) { - $log.error(err); - popupService.showAlert(gettextCatalog.getString('Error'), err); - return $scope.cancel(); - } + wallet = $scope.wallet; + $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; + $scope.color = wallet.color; + $scope.copayerId = wallet.credentials.copayerId; + $scope.isShared = wallet.credentials.n > 1; + $scope.btx.feeLevel = walletSettings.feeLevel; - if (!tx) { - $log.warn('No tx found'); - popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); - return $scope.cancel(); - } + if ($scope.btx.action != 'invalid') { + if ($scope.btx.action == 'sent') $scope.title = gettextCatalog.getString('Sent Funds'); + if ($scope.btx.action == 'received') $scope.title = gettextCatalog.getString('Received Funds'); + if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved Funds'); + } - $scope.btx = lodash.cloneDeep(tx); - $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; - $scope.color = wallet.color; - $scope.copayerId = wallet.credentials.copayerId; - $scope.isShared = wallet.credentials.n > 1; - $scope.btx.feeLevel = walletSettings.feeLevel; + initActionList(); + getAlternativeAmount(); - if ($scope.btx.action != 'invalid') { - if ($scope.btx.action == 'sent') $scope.title = gettextCatalog.getString('Sent Funds'); - if ($scope.btx.action == 'received') $scope.title = gettextCatalog.getString('Received Funds'); - if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved Funds'); - } - - initActionList(); - getAlternativeAmount(); - - $timeout(function() { - $scope.$apply(); - }, 10); - }); - }; - - function findTx(txid, cb) { - walletService.getTxHistory(wallet, {}, function(err, txHistory) { - if (err) return cb(err); - - var tx = lodash.find(txHistory, { - txid: txid - }); - - return cb(null, tx); - }); + $timeout(function() { + $scope.$apply(); + }, 100); }; function initActionList() { @@ -158,8 +126,5 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio $scope.cancel = function() { $scope.txDetailsModal.hide(); - $timeout(function() { - $scope.txDetailsModal.remove(); - }, 10); }; }); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 605c67ee3..2acf9428c 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('tabHomeController', - function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, lodash, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window) { + function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window) { $scope.externalServices = {}; $scope.bitpayCardEnabled = true; // TODO $scope.openTxpModal = txpModalService.open; @@ -17,13 +17,30 @@ angular.module('copayApp.controllers').controller('tabHomeController', }); $scope.openTxModal = function(n) { - $scope.txid = n.txid; - $scope.walletId = n.walletId; - $ionicModal.fromTemplateUrl('views/modals/tx-details.html', { - scope: $scope - }).then(function(modal) { - $scope.txDetailsModal = modal; - $scope.txDetailsModal.show(); + var wallet = profileService.getWallet(n.walletId); + + ongoingProcess.set('loadingTxInfo', true); + walletService.getTx(wallet, n.txid, function(err, tx) { + ongoingProcess.set('loadingTxInfo', false); + + if (err) { + $log.error(err); + return popupService.showAlert(gettextCatalog.getString('Error'), err); + } + + if (!tx) { + $log.warn('No tx found'); + return popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); + } + + $scope.wallet = wallet; + $scope.btx = lodash.cloneDeep(tx); + $ionicModal.fromTemplateUrl('views/modals/tx-details.html', { + scope: $scope + }).then(function(modal) { + $scope.txDetailsModal = modal; + $scope.txDetailsModal.show(); + }); }); }; diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index f9a23f91c..9b1b63c41 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -131,18 +131,13 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.close = function() { $scope.searchModal.hide(); } - }; $scope.openTxModal = function(btx) { - var self = this; - $scope.btx = lodash.cloneDeep(btx); - $scope.self = self; - + $scope.walletId = wallet.id; $ionicModal.fromTemplateUrl('views/modals/tx-details.html', { - scope: $scope, - hideDelay: 500 + scope: $scope }).then(function(modal) { $scope.txDetailsModal = modal; $scope.txDetailsModal.show(); diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index d23c8b906..0af28637b 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -502,6 +502,17 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim }); }; + root.getTx = function(wallet, txid, cb) { + root.getTxHistory(wallet, {}, function(err, txHistory) { + if (err) return cb(err); + + var tx = lodash.find(txHistory, { + txid: txid + }); + + return cb(null, tx); + }); + }; root.getTxHistory = function(wallet, opts, cb) { opts = opts || {}; From 9ce67ed68a5f1445427e97fd0a3040a2e3d52692 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 20 Sep 2016 16:45:43 -0300 Subject: [PATCH 04/13] use cached history first --- src/js/services/walletService.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index 0af28637b..7f2f76e20 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -503,15 +503,23 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim }; root.getTx = function(wallet, txid, cb) { - root.getTxHistory(wallet, {}, function(err, txHistory) { - if (err) return cb(err); - - var tx = lodash.find(txHistory, { + if (wallet.completeHistory && wallet.completeHistory.isValid) { + var tx = lodash.find(wallet.completeHistory, { txid: txid }); return cb(null, tx); - }); + } else { + root.getTxHistory(wallet, {}, function(err, txHistory) { + if (err) return cb(err); + + var tx = lodash.find(txHistory, { + txid: txid + }); + + return cb(null, tx); + }); + } }; root.getTxHistory = function(wallet, opts, cb) { From 53a7a2ff05a7e9c7677afe22094ae111326690df Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 20 Sep 2016 17:05:53 -0300 Subject: [PATCH 05/13] Removes unnecessary icon back elements. Set icon back in route.js --- public/views/add.html | 1 - public/views/addressbook.add.html | 1 - public/views/addressbook.html | 1 - public/views/addressbook.view.html | 1 - public/views/amazon.html | 1 - public/views/amount.html | 1 - public/views/buyAmazon.html | 1 - public/views/buyGlidera.html | 1 - public/views/buyandsell.html | 7 ++----- public/views/confirm.html | 1 - public/views/copayers.html | 1 - public/views/export.html | 1 - public/views/glidera.html | 1 - public/views/import.html | 1 - public/views/join.html | 1 - public/views/paperWallet.html | 1 - public/views/preferences.html | 1 - public/views/preferencesAbout.html | 1 - public/views/preferencesAdvanced.html | 1 - public/views/preferencesAlias.html | 1 - public/views/preferencesAltCurrency.html | 1 - public/views/preferencesBitpayCard.html | 7 ++----- public/views/preferencesBwsUrl.html | 1 - public/views/preferencesColor.html | 1 - public/views/preferencesDeleteWallet.html | 1 - public/views/preferencesDeleteWords.html | 1 - public/views/preferencesEmail.html | 1 - public/views/preferencesFee.html | 1 - public/views/preferencesGlidera.html | 1 - public/views/preferencesHistory.html | 1 - public/views/preferencesInformation.html | 1 - public/views/preferencesLanguage.html | 1 - public/views/preferencesLogs.html | 1 - public/views/preferencesUnit.html | 1 - public/views/proposals.html | 11 +++++------ public/views/sellGlidera.html | 1 - public/views/tab-create-personal.html | 1 - public/views/tab-create-shared.html | 1 - public/views/termsOfUse.html | 1 - public/views/translators.html | 1 - public/views/walletDetails.html | 1 - src/js/routes.js | 2 +- 42 files changed, 10 insertions(+), 55 deletions(-) diff --git a/public/views/add.html b/public/views/add.html index 95230a314..25c3e39c5 100644 --- a/public/views/add.html +++ b/public/views/add.html @@ -2,7 +2,6 @@ {{'Add wallet' | translate}} - diff --git a/public/views/addressbook.add.html b/public/views/addressbook.add.html index bd8307fd0..453cb9a29 100644 --- a/public/views/addressbook.add.html +++ b/public/views/addressbook.add.html @@ -1,7 +1,6 @@ - Add entry diff --git a/public/views/addressbook.html b/public/views/addressbook.html index 88b5869ab..fea7fcf67 100644 --- a/public/views/addressbook.html +++ b/public/views/addressbook.html @@ -1,7 +1,6 @@ - Addressbook diff --git a/public/views/addressbook.view.html b/public/views/addressbook.view.html index 6b215612e..15022a146 100644 --- a/public/views/addressbook.view.html +++ b/public/views/addressbook.view.html @@ -1,7 +1,6 @@ - Addressbook diff --git a/public/views/amazon.html b/public/views/amazon.html index acc17ea58..285725c86 100644 --- a/public/views/amazon.html +++ b/public/views/amazon.html @@ -1,7 +1,6 @@ - Amazon.com Gift Cards diff --git a/public/views/amount.html b/public/views/amount.html index 7a1b1f613..575706ef2 100644 --- a/public/views/amount.html +++ b/public/views/amount.html @@ -1,7 +1,6 @@ - diff --git a/public/views/buyAmazon.html b/public/views/buyAmazon.html index 6fea44d8d..738588f85 100644 --- a/public/views/buyAmazon.html +++ b/public/views/buyAmazon.html @@ -1,7 +1,6 @@ - Buy diff --git a/public/views/buyGlidera.html b/public/views/buyGlidera.html index f315aa11f..c06787829 100644 --- a/public/views/buyGlidera.html +++ b/public/views/buyGlidera.html @@ -1,7 +1,6 @@ - Buy diff --git a/public/views/buyandsell.html b/public/views/buyandsell.html index 3a06db502..05fcb2313 100644 --- a/public/views/buyandsell.html +++ b/public/views/buyandsell.html @@ -1,10 +1,7 @@ - - - + + Buy and sell diff --git a/public/views/confirm.html b/public/views/confirm.html index 8cf5f6196..e8123e096 100644 --- a/public/views/confirm.html +++ b/public/views/confirm.html @@ -1,7 +1,6 @@ - diff --git a/public/views/copayers.html b/public/views/copayers.html index 4ece2b49e..122be4007 100644 --- a/public/views/copayers.html +++ b/public/views/copayers.html @@ -2,7 +2,6 @@ - diff --git a/public/views/export.html b/public/views/export.html index 0d17c0124..56d0d84ce 100644 --- a/public/views/export.html +++ b/public/views/export.html @@ -2,7 +2,6 @@ {{'Export wallet' | translate}} - diff --git a/public/views/glidera.html b/public/views/glidera.html index c68df1e87..33b67f386 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -1,7 +1,6 @@ - Glidera diff --git a/public/views/import.html b/public/views/import.html index aa6d916a2..81c80f651 100644 --- a/public/views/import.html +++ b/public/views/import.html @@ -2,7 +2,6 @@ {{'Import Wallet' | translate}} - diff --git a/public/views/join.html b/public/views/join.html index 6798b95bb..f21080820 100644 --- a/public/views/join.html +++ b/public/views/join.html @@ -1,7 +1,6 @@ - {{'Join shared wallet' | translate}} diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index ed1dede89..8308826d7 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -2,7 +2,6 @@ {{'Sweep paper wallet' | translate}} - diff --git a/public/views/preferences.html b/public/views/preferences.html index fa1b74027..18b7c15e0 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesAbout.html b/public/views/preferencesAbout.html index 3449b8f1e..f16c2f83a 100644 --- a/public/views/preferencesAbout.html +++ b/public/views/preferencesAbout.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 1fcc94c14..e17faed43 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -2,7 +2,6 @@ {{'Advanced Preferences' | translate}} - diff --git a/public/views/preferencesAlias.html b/public/views/preferencesAlias.html index 053986d67..281c1ec09 100644 --- a/public/views/preferencesAlias.html +++ b/public/views/preferencesAlias.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesAltCurrency.html b/public/views/preferencesAltCurrency.html index 446a50074..bf500edde 100644 --- a/public/views/preferencesAltCurrency.html +++ b/public/views/preferencesAltCurrency.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesBitpayCard.html b/public/views/preferencesBitpayCard.html index c3dfe26c0..12ae0a455 100644 --- a/public/views/preferencesBitpayCard.html +++ b/public/views/preferencesBitpayCard.html @@ -1,10 +1,7 @@ - - - + + Preferences diff --git a/public/views/preferencesBwsUrl.html b/public/views/preferencesBwsUrl.html index 4cb483b88..1c0f36a73 100644 --- a/public/views/preferencesBwsUrl.html +++ b/public/views/preferencesBwsUrl.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesColor.html b/public/views/preferencesColor.html index c0790e3ea..838973f1f 100644 --- a/public/views/preferencesColor.html +++ b/public/views/preferencesColor.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesDeleteWallet.html b/public/views/preferencesDeleteWallet.html index 0cc6f099b..62a7e7e84 100644 --- a/public/views/preferencesDeleteWallet.html +++ b/public/views/preferencesDeleteWallet.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesDeleteWords.html b/public/views/preferencesDeleteWords.html index 25a3eaedc..989fd06e5 100644 --- a/public/views/preferencesDeleteWords.html +++ b/public/views/preferencesDeleteWords.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesEmail.html b/public/views/preferencesEmail.html index d7a81e90e..428864ff6 100644 --- a/public/views/preferencesEmail.html +++ b/public/views/preferencesEmail.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesFee.html b/public/views/preferencesFee.html index fb178fbf8..a0b0b98b0 100644 --- a/public/views/preferencesFee.html +++ b/public/views/preferencesFee.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesGlidera.html b/public/views/preferencesGlidera.html index 2f04020a1..8e87c02be 100644 --- a/public/views/preferencesGlidera.html +++ b/public/views/preferencesGlidera.html @@ -1,7 +1,6 @@ - Preferences diff --git a/public/views/preferencesHistory.html b/public/views/preferencesHistory.html index 1118a2a99..d27db7837 100644 --- a/public/views/preferencesHistory.html +++ b/public/views/preferencesHistory.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesInformation.html b/public/views/preferencesInformation.html index 2fe6298ce..ca7397013 100644 --- a/public/views/preferencesInformation.html +++ b/public/views/preferencesInformation.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesLanguage.html b/public/views/preferencesLanguage.html index df04e0160..53da39d3e 100644 --- a/public/views/preferencesLanguage.html +++ b/public/views/preferencesLanguage.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesLogs.html b/public/views/preferencesLogs.html index 8d2d1311b..080f52223 100644 --- a/public/views/preferencesLogs.html +++ b/public/views/preferencesLogs.html @@ -1,7 +1,6 @@ - diff --git a/public/views/preferencesUnit.html b/public/views/preferencesUnit.html index 520f43fce..102964d6b 100644 --- a/public/views/preferencesUnit.html +++ b/public/views/preferencesUnit.html @@ -1,7 +1,6 @@ - diff --git a/public/views/proposals.html b/public/views/proposals.html index 0f3306ddc..5599b8559 100644 --- a/public/views/proposals.html +++ b/public/views/proposals.html @@ -1,12 +1,11 @@ - Pending Proposals - - - + + {{'Pending Proposals'|translate}} + + + diff --git a/public/views/sellGlidera.html b/public/views/sellGlidera.html index cb2bc0f77..75a12c8c3 100644 --- a/public/views/sellGlidera.html +++ b/public/views/sellGlidera.html @@ -1,7 +1,6 @@ - Sell diff --git a/public/views/tab-create-personal.html b/public/views/tab-create-personal.html index 754afc81d..506709f63 100644 --- a/public/views/tab-create-personal.html +++ b/public/views/tab-create-personal.html @@ -2,7 +2,6 @@ {{'Create Personal Wallet' | translate}} - diff --git a/public/views/tab-create-shared.html b/public/views/tab-create-shared.html index db6420a7a..914976dc2 100644 --- a/public/views/tab-create-shared.html +++ b/public/views/tab-create-shared.html @@ -2,7 +2,6 @@ {{'Create Shared Wallet' | translate}} - diff --git a/public/views/termsOfUse.html b/public/views/termsOfUse.html index 7fd05725a..0d1241741 100644 --- a/public/views/termsOfUse.html +++ b/public/views/termsOfUse.html @@ -1,7 +1,6 @@ - diff --git a/public/views/translators.html b/public/views/translators.html index cb865e3eb..5fbbdd44e 100644 --- a/public/views/translators.html +++ b/public/views/translators.html @@ -2,7 +2,6 @@ {{'Translators' | translate}} - diff --git a/public/views/walletDetails.html b/public/views/walletDetails.html index dd4394ad1..74ab1f04e 100644 --- a/public/views/walletDetails.html +++ b/public/views/walletDetails.html @@ -2,7 +2,6 @@ {{walletDetailsName}} - - + + diff --git a/public/views/glideraUri.html b/public/views/glideraUri.html index 453da1668..1d4b4294f 100644 --- a/public/views/glideraUri.html +++ b/public/views/glideraUri.html @@ -1,10 +1,7 @@ - - - + + Glidera From 6b01f0da5224e5325fe2beab6148e40a31f2505b Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 21 Sep 2016 12:26:44 -0300 Subject: [PATCH 12/13] fix open sent tx modal --- src/js/controllers/activity.js | 2 +- src/js/controllers/tab-home.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/activity.js b/src/js/controllers/activity.js index 025a4b062..615dc13bb 100644 --- a/src/js/controllers/activity.js +++ b/src/js/controllers/activity.js @@ -25,7 +25,7 @@ angular.module('copayApp.controllers').controller('activityController', }; $scope.openNotificationModal = function(n) { - if (!n.txpId && n.txid) { + if (n.txid) { openTxModal(n); } else { var txp = lodash.find($scope.txps, { diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 12d7547c5..cd6ae94e5 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -17,7 +17,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', }); $scope.openNotificationModal = function(n) { - if (!n.txpId && n.txid) { + if (n.txid) { openTxModal(n); } else { var txp = lodash.find($scope.txps, { From 6cce7d5a23ad8aa7f278e76b786761d3ccf8677f Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 21 Sep 2016 12:38:49 -0300 Subject: [PATCH 13/13] fix parameters on popup call --- src/js/controllers/activity.js | 4 ++-- src/js/controllers/tab-home.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/controllers/activity.js b/src/js/controllers/activity.js index 615dc13bb..696730bff 100644 --- a/src/js/controllers/activity.js +++ b/src/js/controllers/activity.js @@ -34,7 +34,7 @@ angular.module('copayApp.controllers').controller('activityController', if (txp) txpModalService.open(txp); else { $log.warn('No txp found'); - return popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); + return popupService.showAlert(null, gettextCatalog.getString('Transaction not found')); } } }; @@ -53,7 +53,7 @@ angular.module('copayApp.controllers').controller('activityController', if (!tx) { $log.warn('No tx found'); - return popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); + return popupService.showAlert(null, gettextCatalog.getString('Transaction not found')); } $scope.wallet = wallet; diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index cd6ae94e5..95c0908f3 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -26,7 +26,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', if (txp) txpModalService.open(txp); else { $log.warn('No txp found'); - return popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); + return popupService.showAlert(null, gettextCatalog.getString('Transaction not found')); } } }; @@ -45,7 +45,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', if (!tx) { $log.warn('No tx found'); - return popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); + return popupService.showAlert(null, gettextCatalog.getString('Transaction not found')); } $scope.wallet = wallet;