From 35756cf529d43cadbfbc2b0830d41df36046457d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 23 Sep 2016 12:42:33 -0300 Subject: [PATCH 1/7] fixes --- public/views/modals/tx-details.html | 2 +- public/views/preferences.html | 6 +-- public/views/tab-export-file.html | 6 +-- src/js/controllers/addressbookAdd.js | 2 +- src/js/controllers/amount.js | 11 ++-- src/js/controllers/backup.js | 2 +- src/js/controllers/confirm.js | 20 ++++---- src/js/controllers/create.js | 3 +- src/js/controllers/export.js | 4 +- src/js/controllers/import.js | 1 + src/js/controllers/join.js | 2 +- src/js/controllers/modals/txDetails.js | 2 +- src/js/controllers/modals/txStatus.js | 2 +- src/js/controllers/paperWallet.js | 4 +- src/js/controllers/paymentUri.js | 2 +- src/js/controllers/preferences.js | 21 +++++--- src/js/controllers/preferencesHistory.js | 4 +- src/js/controllers/preferencesInformation.js | 10 ++-- src/js/controllers/preferencesLogs.js | 53 ++++++++++---------- src/js/controllers/tab-settings.js | 14 ++++-- src/js/services/applicationService.js | 2 +- 21 files changed, 92 insertions(+), 81 deletions(-) diff --git a/public/views/modals/tx-details.html b/public/views/modals/tx-details.html index 797909be6..31d46c5f0 100644 --- a/public/views/modals/tx-details.html +++ b/public/views/modals/tx-details.html @@ -75,7 +75,7 @@
-
+
Date diff --git a/public/views/preferences.html b/public/views/preferences.html index 77b2d7ea1..1507f1d18 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -19,7 +19,7 @@ Hardware Wallet - {{wallet.externalSource}} + {{externalSource}}
@@ -45,12 +45,12 @@
- + Request Spending Password
- + Request Fingerprint
diff --git a/public/views/tab-export-file.html b/public/views/tab-export-file.html index 70fc041c4..31eb7d51a 100644 --- a/public/views/tab-export-file.html +++ b/public/views/tab-export-file.html @@ -29,7 +29,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
@@ -90,4 +90,4 @@

Copy this text as it is to a safe place (notepad or email)

-
\ No newline at end of file +
diff --git a/src/js/controllers/addressbookAdd.js b/src/js/controllers/addressbookAdd.js index 4b22e12ca..12d0305af 100644 --- a/src/js/controllers/addressbookAdd.js +++ b/src/js/controllers/addressbookAdd.js @@ -37,7 +37,7 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu }; $scope.goHome = function() { - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); }; diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index ae8d8a935..19a0c2b26 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -10,7 +10,11 @@ angular.module('copayApp.controllers').controller('amountController', function($ var SMALL_FONT_SIZE_LIMIT = 13; var LENGTH_EXPRESSION_LIMIT = 19; - $scope.$on("$ionicView.enter", function(event, data){ + $scope.toAddress = $stateParams.toAddress; + $scope.toName = $stateParams.toName; + $scope.toEmail = $stateParams.toEmail; + + $scope.$on("$ionicView.beforeEnter", function(event, data) { if (!$stateParams.toAddress) { $log.error('Bad params at amount') @@ -46,11 +50,6 @@ angular.module('copayApp.controllers').controller('amountController', function($ angular.element($window).off('keydown'); }); - - $scope.toAddress = $stateParams.toAddress; - $scope.toName = $stateParams.toName; - $scope.toEmail = $stateParams.toEmail; - var config = configService.getSync().wallet.settings; $scope.unitName = config.unitName; $scope.alternativeIsoCode = config.alternativeIsoCode; diff --git a/src/js/controllers/backup.js b/src/js/controllers/backup.js index dc4217499..ea28fdaad 100644 --- a/src/js/controllers/backup.js +++ b/src/js/controllers/backup.js @@ -97,7 +97,7 @@ angular.module('copayApp.controllers').controller('backupController', if ($stateParams.fromOnboarding) { $state.go('onboarding.disclaimer'); } else { - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); } }; diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 3794fb43f..722c075ab 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -4,6 +4,16 @@ angular.module('copayApp.controllers').controller('confirmController', function( var cachedTxp = {}; var isChromeApp = platformInfo.isChromeApp; + $scope.toAddress = $stateParams.toAddress; + $scope.toName = $stateParams.toName; + $scope.toEmail = $stateParams.toEmail; + $scope.description = $stateParams.description; + $scope.paypro = $stateParams.paypro; + + $scope.$on("$ionicView.enter", function(event, data) { + initConfirm(); + }); + var initConfirm = function() { if ($stateParams.paypro) { return setFromPayPro($stateParams.paypro, function(err) { @@ -26,12 +36,6 @@ angular.module('copayApp.controllers').controller('confirmController', function( var amount = $scope.toAmount = parseInt($stateParams.toAmount); $scope.amountStr = txFormatService.formatAmountStr($scope.toAmount); - $scope.toAddress = $stateParams.toAddress; - $scope.toName = $stateParams.toName; - $scope.toEmail = $stateParams.toEmail; - $scope.description = $stateParams.description; - $scope.paypro = $stateParams.paypro; - var networkName = (new bitcore.Address($scope.toAddress)).network.name; $scope.network = networkName; @@ -306,8 +310,4 @@ angular.module('copayApp.controllers').controller('confirmController', function( $scope.cancel = function() { $state.go('tabs.send'); }; - - $scope.$on("$ionicView.enter", function(event, data) { - initConfirm(); - }); }); diff --git a/src/js/controllers/create.js b/src/js/controllers/create.js index 012143336..84c77275f 100644 --- a/src/js/controllers/create.js +++ b/src/js/controllers/create.js @@ -175,12 +175,11 @@ angular.module('copayApp.controllers').controller('createController', if ($scope.seedSource.id == 'set') { profileService.setBackupFlag(client.credentials.walletId); } - + $ionicHistory.removeBackView(); if (!client.isComplete()) { $ionicHistory.nextViewOptions({ disableAnimate: true }); - $ionicHistory.removeBackView(); $state.go('tabs.home'); $timeout(function() { $state.transitionTo('tabs.copayers', { diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js index d9e70d5b6..4d7aed6c0 100644 --- a/src/js/controllers/export.js +++ b/src/js/controllers/export.js @@ -71,7 +71,7 @@ angular.module('copayApp.controllers').controller('exportController', popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Failed to export')); return; } - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); }); }); @@ -158,7 +158,7 @@ angular.module('copayApp.controllers').controller('exportController', }); }; - $scope.$on("$ionicView.enter", function(event, data){ + $scope.$on("$ionicView.beforeEnter", function(event, data) { init(); }); diff --git a/src/js/controllers/import.js b/src/js/controllers/import.js index 45d03da1f..388360787 100644 --- a/src/js/controllers/import.js +++ b/src/js/controllers/import.js @@ -345,6 +345,7 @@ angular.module('copayApp.controllers').controller('importController', if (err) $log.error(err); }); } + $ionicHistory.removeBackView(); $state.go('tabs.home', { fromOnboarding: $stateParams.fromOnboarding }); diff --git a/src/js/controllers/join.js b/src/js/controllers/join.js index 757a584b9..f983e25c5 100644 --- a/src/js/controllers/join.js +++ b/src/js/controllers/join.js @@ -145,7 +145,7 @@ angular.module('copayApp.controllers').controller('joinController', walletService.updateRemotePreferences(client, {}, function() { $log.debug('Remote preferences saved for:' + client.credentials.walletId) }); - + $ionicHistory.removeBackView(); $state.go('tabs.home'); }); }, 100); diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js index b4e45dae1..b2c18fc32 100644 --- a/src/js/controllers/modals/txDetails.js +++ b/src/js/controllers/modals/txDetails.js @@ -6,7 +6,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio var walletSettings = configWallet.settings; var wallet; $scope.title = gettextCatalog.getString('Transaction'); - + console.log($scope.btx); $scope.init = function() { wallet = $scope.wallet; $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; diff --git a/src/js/controllers/modals/txStatus.js b/src/js/controllers/modals/txStatus.js index ceb4065f8..647476257 100644 --- a/src/js/controllers/modals/txStatus.js +++ b/src/js/controllers/modals/txStatus.js @@ -5,7 +5,7 @@ angular.module('copayApp.controllers').controller('txStatusController', function if ($scope.cb) $timeout($scope.cb, 100); $scope.cancel = function() { - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); $scope.txStatusModal.hide(); }; diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 7025e8bf5..e346863a4 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -96,7 +96,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', popupService.showAlert(gettextCatalog.getString('Error sweeping wallet:'), err || err.toString()); } else { $scope.openStatusModal('broadcasted', function() { - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); }); } @@ -120,7 +120,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', }); }; - $scope.$on("$ionicView.enter", function(event, data){ + $scope.$on("$ionicView.enter", function(event, data) { var wallet = profileService.getWallet($stateParams.walletId); $scope.wallet = wallet; $scope.isCordova = platformInfo.isCordova; diff --git a/src/js/controllers/paymentUri.js b/src/js/controllers/paymentUri.js index 70cf15d51..803f52a2e 100644 --- a/src/js/controllers/paymentUri.js +++ b/src/js/controllers/paymentUri.js @@ -47,7 +47,7 @@ angular.module('copayApp.controllers').controller('paymentUriController', this.selectWallet = function(wid) { var self = this; profileService.setAndStoreFocus(wid, function() {}); - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); $timeout(function() { $rootScope.$emit('paymentUri', self.bitcoinURI); diff --git a/src/js/controllers/preferences.js b/src/js/controllers/preferences.js index a93d7b260..3ab7cf1de 100644 --- a/src/js/controllers/preferences.js +++ b/src/js/controllers/preferences.js @@ -8,7 +8,7 @@ angular.module('copayApp.controllers').controller('preferencesController', $scope.encryptChange = function() { if (!wallet) return; - var val = $scope.encryptEnabled; + var val = $scope.encryptEnabled.value; if (val && !walletService.isEncrypted(wallet)) { $log.debug('Encrypting private key for', wallet.name); @@ -17,7 +17,7 @@ angular.module('copayApp.controllers').controller('preferencesController', $log.warn(err); // ToDo show error? - $scope.encryptEnabled = false; + $scope.encryptEnabled.value = false; return; } profileService.updateCredentials(JSON.parse(wallet.export()), function() { @@ -31,7 +31,7 @@ angular.module('copayApp.controllers').controller('preferencesController', $log.warn(err); // ToDo show error? - $scope.encryptEnabled = true; + $scope.encryptEnabled.value = true; return; } profileService.updateCredentials(JSON.parse(wallet.export()), function() { @@ -43,10 +43,10 @@ angular.module('copayApp.controllers').controller('preferencesController', }; $scope.touchIdChange = function() { - var newStatus = $scope.touchIdEnabled; + var newStatus = $scope.touchIdEnabled.value; walletService.setTouchId(wallet, !!newStatus, function(err) { if (err) { - $scope.touchIdEnabled = !newStatus; + $scope.touchIdEnabled.value = !newStatus; $timeout(function() { $scope.$apply(); }, 1); @@ -56,7 +56,7 @@ angular.module('copayApp.controllers').controller('preferencesController', }); }; - $scope.$on("$ionicView.beforeEnter", function(event, data){ + $scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.externalSource = null; if (!wallet) @@ -64,12 +64,17 @@ angular.module('copayApp.controllers').controller('preferencesController', var config = configService.getSync(); - $scope.encryptEnabled = walletService.isEncrypted(wallet); + $scope.encryptEnabled = { + value: walletService.isEncrypted(wallet) + }; + if (wallet.isPrivKeyExternal) $scope.externalSource = wallet.getPrivKeyExternalSourceName() == 'ledger' ? 'Ledger' : 'Trezor'; $scope.touchIdAvailable = fingerprintService.isAvailable(); - $scope.touchIdEnabled = config.touchIdFor ? config.touchIdFor[walletId] : null; + $scope.touchIdEnabled = { + value: config.touchIdFor ? config.touchIdFor[walletId] : null + }; $scope.deleted = false; if (wallet.credentials && !wallet.credentials.mnemonicEncrypted && !wallet.credentials.mnemonic) { diff --git a/src/js/controllers/preferencesHistory.js b/src/js/controllers/preferencesHistory.js index d65eca2d5..b1d06c098 100644 --- a/src/js/controllers/preferencesHistory.js +++ b/src/js/controllers/preferencesHistory.js @@ -125,13 +125,13 @@ angular.module('copayApp.controllers').controller('preferencesHistory', $scope.$emit('Local/ClearHistory'); $timeout(function() { - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); }, 100); }); }; - $scope.$on("$ionicView.enter", function(event, data){ + $scope.$on("$ionicView.enter", function(event, data) { $scope.csvHistory(); }); }); diff --git a/src/js/controllers/preferencesInformation.js b/src/js/controllers/preferencesInformation.js index 0ffaa78a2..3cbac1bab 100644 --- a/src/js/controllers/preferencesInformation.js +++ b/src/js/controllers/preferencesInformation.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesInformation', - function($scope, $log, $timeout, $ionicHistory, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) { + function($scope, $log, $timeout, $ionicHistory, $ionicScrollDelegate, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) { var base = 'xpub'; var wallet = profileService.getWallet($stateParams.walletId); var walletId = wallet.id; @@ -65,7 +65,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation', opts.colorFor[walletId] = color; configService.set(opts, function(err) { - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); if (err) $log.warn(err); }); @@ -77,11 +77,11 @@ angular.module('copayApp.controllers').controller('preferencesInformation', $scope.scan = function() { walletService.startScan(wallet); - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); }; - $scope.$on("$ionicView.enter", function(event, data){ + $scope.$on("$ionicView.enter", function(event, data) { var c = wallet.credentials; var basePath = c.getBaseAddressDerivationPath(); @@ -116,7 +116,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation', $timeout(function() { $scope.$apply(); }); - + $ionicScrollDelegate.resize(); }); }); diff --git a/src/js/controllers/preferencesLogs.js b/src/js/controllers/preferencesLogs.js index 8cb067e7a..43d5d42cb 100644 --- a/src/js/controllers/preferencesLogs.js +++ b/src/js/controllers/preferencesLogs.js @@ -3,32 +3,33 @@ angular.module('copayApp.controllers').controller('preferencesLogs', function($scope, historicLog, gettextCatalog) { - $scope.prepare = function() { - var log = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n'; - log += '\n\n'; - log += $scope.logs.map(function(v) { - return v.msg; - }).join('\n'); - - return log; - }; - - $scope.sendLogs = function() { - var body = $scope.prepare(); - - window.plugins.socialsharing.shareViaEmail( - body, - 'Copay Logs', - null, // TO: must be null or an array - null, // CC: must be null or an array - null, // BCC: must be null or an array - null, // FILES: can be null, a string, or an array - function() {}, - function() {} - ); - }; - - $scope.$on("$ionicView.enter", function(event, data){ + $scope.$on("$ionicView.enter", function(event, data) { $scope.logs = historicLog.get(); + + $scope.prepare = function() { + var log = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n'; + log += '\n\n'; + log += $scope.logs.map(function(v) { + return v.msg; + }).join('\n'); + + return log; + }; + + $scope.sendLogs = function() { + var body = $scope.prepare(); + + window.plugins.socialsharing.shareViaEmail( + body, + 'Copay Logs', + null, // TO: must be null or an array + null, // CC: must be null or an array + null, // BCC: must be null or an array + null, // FILES: can be null, a string, or an array + function() {}, + function() {} + ); + }; + }); }); diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js index 310803cdd..f8f13202c 100644 --- a/src/js/controllers/tab-settings.js +++ b/src/js/controllers/tab-settings.js @@ -28,10 +28,16 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct $scope.$digest(); }); } - $scope.spendUnconfirmed = {value : config.wallet.spendUnconfirmed}; - $scope.glideraEnabled = {value: config.glidera.enabled}; + $scope.spendUnconfirmed = { + value: config.wallet.spendUnconfirmed + }; + $scope.glideraEnabled = { + value: config.glidera.enabled + }; $scope.coinbaseEnabled = config.coinbase.enabled; - $scope.pushNotifications = {value: config.pushNotifications.enabled}; + $scope.pushNotifications = { + value: config.pushNotifications.enabled + }; $scope.otherWallets = lodash.filter(profileService.getWallets(self.network), function(w) { return w.id != self.walletId; }); @@ -94,7 +100,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct }); }; - $scope.$on("$ionicView.enter", function(event, data){ + $scope.$on("$ionicView.enter", function(event, data) { updateConfig(); }); diff --git a/src/js/services/applicationService.js b/src/js/services/applicationService.js index 6c7de2954..7ec528f46 100644 --- a/src/js/services/applicationService.js +++ b/src/js/services/applicationService.js @@ -19,7 +19,7 @@ angular.module('copayApp.services') if (isChromeApp) { chrome.runtime.reload(); } else if (isNW) { - $ionicHistory.clearHistory(); + $ionicHistory.removeBackView(); $state.go('tabs.home'); $timeout(function() { var win = require('nw.gui').Window.get(); From aa53dd492694b5a4db70206f71986c6f0d48664e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 23 Sep 2016 12:45:07 -0300 Subject: [PATCH 2/7] remove console log --- src/js/controllers/modals/txDetails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js index b2c18fc32..b4e45dae1 100644 --- a/src/js/controllers/modals/txDetails.js +++ b/src/js/controllers/modals/txDetails.js @@ -6,7 +6,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio var walletSettings = configWallet.settings; var wallet; $scope.title = gettextCatalog.getString('Transaction'); - console.log($scope.btx); + $scope.init = function() { wallet = $scope.wallet; $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; From 6955f8728d2664e092a075643835f948edbe1564 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 23 Sep 2016 13:05:50 -0300 Subject: [PATCH 3/7] Fix amazon --- public/views/buyAmazon.html | 4 ++-- src/js/controllers/amazon.js | 5 +++-- src/js/controllers/buyAmazon.js | 7 ++++--- src/js/controllers/modals/txStatus.js | 8 +++++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/public/views/buyAmazon.html b/public/views/buyAmazon.html index 8f6b69668..30dadf8c9 100644 --- a/public/views/buyAmazon.html +++ b/public/views/buyAmazon.html @@ -42,7 +42,7 @@ ng-attr-placeholder="{{'Amount in USD'}}" min="0.01" max="500" - ng-model="fiat" + ng-model="formData.fiat" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" step="0.01" autocomplete="off" ignore-mouse-wheel required> @@ -53,7 +53,7 @@ diff --git a/src/js/controllers/amazon.js b/src/js/controllers/amazon.js index 564291fbe..954c35c24 100644 --- a/src/js/controllers/amazon.js +++ b/src/js/controllers/amazon.js @@ -3,12 +3,13 @@ angular.module('copayApp.controllers').controller('amazonController', function($scope, $timeout, $ionicModal, $log, lodash, bwcError, amazonService, platformInfo, externalLinkService, popupService) { + $scope.network = amazonService.getEnvironment(); + $scope.openExternalLink = function(url, target) { externalLinkService.open(url, target); }; var initAmazon = function() { - $scope.network = amazonService.getEnvironment(); amazonService.getPendingGiftCards(function(err, gcds) { if (err) { popupService.showAlert(err); @@ -82,7 +83,7 @@ angular.module('copayApp.controllers').controller('amazonController', }); }; - $scope.$on("$ionicView.enter", function(event, data){ + $scope.$on("$ionicView.beforeEnter", function(event, data){ initAmazon(); }); }); diff --git a/src/js/controllers/buyAmazon.js b/src/js/controllers/buyAmazon.js index 70817a1aa..903e2a682 100644 --- a/src/js/controllers/buyAmazon.js +++ b/src/js/controllers/buyAmazon.js @@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController', function($scope, $log, $timeout, $state, lodash, profileService, bwcError, gettextCatalog, configService, walletService, amazonService, ongoingProcess, platformInfo, externalLinkService, popupService) { var self = this; + var network = amazonService.getEnvironment(); var wallet; $scope.$on('Wallet/Changed', function(event, w) { @@ -20,7 +21,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController', }; this.confirm = function() { - var message = gettextCatalog.getString('Amazon.com Gift Card purchase for ${{amount}} USD', {amount: $scope.fiat}); + var message = gettextCatalog.getString('Amazon.com Gift Card purchase for ${{amount}} USD', {amount: $scope.formData.fiat}); var ok = gettextCatalog.getString('Buy'); popupService.showConfirm(null, message, ok, null, function(res) { if (res) self.createTx(); @@ -40,7 +41,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController', var dataSrc = { currency: 'USD', - amount: $scope.fiat, + amount: $scope.formData.fiat, uuid: wallet.id }; var outputs = []; @@ -209,7 +210,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController', }; $scope.$on("$ionicView.enter", function(event, data){ - var network = amazonService.getEnvironment(); + $scope.formData = { fiat: null }; $scope.wallets = profileService.getWallets({ network: network, onlyComplete: true diff --git a/src/js/controllers/modals/txStatus.js b/src/js/controllers/modals/txStatus.js index c69e34180..4127d2172 100644 --- a/src/js/controllers/modals/txStatus.js +++ b/src/js/controllers/modals/txStatus.js @@ -3,11 +3,14 @@ angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout, $state, $ionicHistory, $log, addressbookService) { if ($scope.cb) $timeout($scope.cb, 100); + $scope.fromSendTab = $ionicHistory.viewHistory().backView.stateName === "tabs.send.amount"; $scope.cancel = function() { - $ionicHistory.removeBackView(); - $state.go('tabs.home'); $scope.txStatusModal.hide(); + if ($scope.fromSendTab) { + $ionicHistory.removeBackView(); + $state.go('tabs.home'); + } }; $scope.save = function(addressbookEntry) { @@ -23,7 +26,6 @@ angular.module('copayApp.controllers').controller('txStatusController', function }); } - $scope.fromSendTab = $ionicHistory.viewHistory().backView.stateName === "tabs.send.amount"; addressbookService.list(function(err, ab) { if (err) $log.error(err); if (ab[$scope.tx.toAddress]) { From 2b3fb7eea4388b0009044428d5fdd5cc807db732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 23 Sep 2016 13:30:58 -0300 Subject: [PATCH 4/7] fix alias --- public/views/preferencesAlias.html | 2 +- src/js/controllers/preferencesAlias.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/views/preferencesAlias.html b/public/views/preferencesAlias.html index fb1c4a1c7..7195225f7 100644 --- a/public/views/preferencesAlias.html +++ b/public/views/preferencesAlias.html @@ -11,7 +11,7 @@
diff --git a/src/js/controllers/buyGlidera.js b/src/js/controllers/buyGlidera.js index a68751d18..e25612418 100644 --- a/src/js/controllers/buyGlidera.js +++ b/src/js/controllers/buyGlidera.js @@ -7,6 +7,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController', var self = this; this.show2faCodeInput = null; this.success = null; + $scope.network = glideraService.getEnvironment(); $scope.$on('Wallet/Changed', function(event, w) { if (lodash.isEmpty(w)) { @@ -116,9 +117,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController', }; $scope.$on("$ionicView.enter", function(event, data){ - $scope.network = glideraService.getEnvironment(); - - $scope.token = accessToken; + $scope.token = null; $scope.permissions = null; $scope.email = null; $scope.personalInfo = null; diff --git a/src/js/controllers/glidera.js b/src/js/controllers/glidera.js index c909e9aa2..9f701e984 100644 --- a/src/js/controllers/glidera.js +++ b/src/js/controllers/glidera.js @@ -3,13 +3,13 @@ angular.module('copayApp.controllers').controller('glideraController', function($scope, $timeout, $ionicModal, $log, storageService, glideraService, ongoingProcess, platformInfo, externalLinkService, popupService, gettextCatalog) { + $scope.network = glideraService.getEnvironment(); + $scope.openExternalLink = function(url, target) { externalLinkService.open(url, target); }; var initGlidera = function(accessToken) { - $scope.network = glideraService.getEnvironment(); - $scope.token = null; $scope.permissions = null; $scope.email = null; @@ -113,7 +113,7 @@ angular.module('copayApp.controllers').controller('glideraController', }); }; - $scope.$on("$ionicView.enter", function(event, data){ + $scope.$on("$ionicView.beforeEnter", function(event, data){ initGlidera(); }); diff --git a/src/js/controllers/sellGlidera.js b/src/js/controllers/sellGlidera.js index defc5067c..be19a4298 100644 --- a/src/js/controllers/sellGlidera.js +++ b/src/js/controllers/sellGlidera.js @@ -8,6 +8,7 @@ angular.module('copayApp.controllers').controller('sellGlideraController', this.show2faCodeInput = null; this.success = null; var wallet; + $scope.network = glideraService.getEnvironment(); $scope.$on('Wallet/Changed', function(event, w) { if (lodash.isEmpty(w)) { @@ -189,9 +190,7 @@ angular.module('copayApp.controllers').controller('sellGlideraController', }; $scope.$on("$ionicView.enter", function(event, data){ - $scope.network = glideraService.getEnvironment(); - - $scope.token = accessToken; + $scope.token = null; $scope.permissions = null; $scope.email = null; $scope.personalInfo = null; diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index acd08dfde..58aaf6aef 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -84,6 +84,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }; $scope.$on("$ionicView.enter", function(event, data){ + $scope.formData = { search: null }; updateList(); }); From af9b73fd08a8f4c5f0bf09c241f97467e53d137e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 23 Sep 2016 13:40:03 -0300 Subject: [PATCH 7/7] fix bws url --- public/views/preferencesBwsUrl.html | 2 +- src/js/controllers/preferencesBwsUrl.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/public/views/preferencesBwsUrl.html b/public/views/preferencesBwsUrl.html index 592f7d213..d1cfa1b37 100644 --- a/public/views/preferencesBwsUrl.html +++ b/public/views/preferencesBwsUrl.html @@ -9,7 +9,7 @@