From d5766485ecde06237824b708ac7b71e10557336b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Thu, 8 Sep 2016 16:19:45 -0300 Subject: [PATCH 01/23] handle get keys exception --- src/js/controllers/backup.js | 1 + src/js/services/walletService.js | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/backup.js b/src/js/controllers/backup.js index ce0cba754..15d4e2168 100644 --- a/src/js/controllers/backup.js +++ b/src/js/controllers/backup.js @@ -25,6 +25,7 @@ angular.module('copayApp.controllers').controller('backupController', walletService.getKeys(wallet, function(err, k) { if (err || !k) { + $log.error('Could not get keys: ', err); $state.go('wallet.preferences'); return; } diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index f5bf2e45d..c86246b51 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -861,7 +861,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim askPassword(wallet.name, gettext('Enter Spending Password'), function(password) { if (!password) return cb('no password'); if (!wallet.checkPassword(password)) return cb('wrong password'); - + return cb(null, password); }); @@ -956,8 +956,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim $rootScope.$emit('Local/TxAction', wallet.id); var type = root.getViewStatus(wallet, broadcastedTxp); - root.openStatusModal(type, broadcastedTxp, function() { - }); + root.openStatusModal(type, broadcastedTxp, function() {}); return cb(null, broadcastedTxp) }); @@ -965,8 +964,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim $rootScope.$emit('Local/TxAction', wallet.id); var type = root.getViewStatus(wallet, signedTxp); - root.openStatusModal(type, signedTxp, function() { - }); + root.openStatusModal(type, signedTxp, function() {}); return cb(null, signedTxp); } }); @@ -1032,7 +1030,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim try { keys = wallet.getKeys(password); } catch (e) { - return cb(err); + return cb(e); } return cb(null, keys); From b64d5dfbeed8d8e04df2b4100e5f0cf6b480e2df Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 8 Sep 2016 16:54:35 -0300 Subject: [PATCH 02/23] fix wallets show --- src/js/controllers/tab-send.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index de70a0a0a..ae2d6ceeb 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -1,13 +1,15 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSendController', function($scope, $ionicModal, $log, $timeout, addressbookService, profileService, lodash, $state, walletService, incomingData ) { +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $ionicModal, $log, $timeout, addressbookService, profileService, lodash, $state, walletService, incomingData) { var originalList; $scope.init = function() { originalList = []; - var wallets = profileService.getWallets({onlyComplete: true}); + var wallets = profileService.getWallets({ + onlyComplete: true + }); lodash.each(wallets, function(v) { originalList.push({ @@ -29,13 +31,17 @@ angular.module('copayApp.controllers').controller('tabSendController', function( label: v, address: k, getAddress: function(cb) { - return cb(null,k); + return cb(null, k); }, }); }); originalList = originalList.concat(contacts); $scope.list = lodash.clone(originalList); + + $timeout(function() { + $scope.$apply(); + }, 1); }); }; @@ -62,13 +68,16 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }; $scope.goToAmount = function(item) { - item.getAddress(function(err,addr){ - if (err|| !addr) { + item.getAddress(function(err, addr) { + if (err || !addr) { $log.error(err); return; } - $log.debug('Got toAddress:' + addr + ' | ' + item.label) - return $state.transitionTo('send.amount', { toAddress: addr, toName: item.label}) + $log.debug('Got toAddress:' + addr + ' | ' + item.label); + return $state.transitionTo('send.amount', { + toAddress: addr, + toName: item.label + }) }); }; From e16e93e408cca59e2d590d8617fc46fa332a2560 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 8 Sep 2016 19:50:18 -0300 Subject: [PATCH 03/23] fix sweep paper wallet flag - fix sweep process --- public/views/paperWallet.html | 156 ++++++++++-------- public/views/preferencesAdvanced.html | 4 +- src/js/controllers/backup.js | 5 +- src/js/controllers/paperWallet.js | 24 ++- .../preferencesAdvancedController.js | 10 ++ 5 files changed, 122 insertions(+), 77 deletions(-) create mode 100644 src/js/controllers/preferencesAdvancedController.js diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index eca39330a..ed1dede89 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -1,84 +1,100 @@ -
-
+ + + {{'Sweep paper wallet' | translate}} + + + + -
-
-
-

-
- - Backup Needed. - - Before receiving funds, you must backup your wallet. If this device is lost, it is impossible to access your funds without a backup. - + +
+
+

+
+ + Backup Needed. + + Before receiving funds, you must backup your wallet. If this device is lost, it is impossible to access your funds without a backup. + +
+
-
-
-
-

-
- {{error|translate}} -
-
-
-
-
- - -
- -
-
-
-
+ + diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index e63d6eb8c..1fcc94c14 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -5,7 +5,7 @@ - +
@@ -13,7 +13,7 @@ Wallet Information - + Sweep paper wallet diff --git a/src/js/controllers/backup.js b/src/js/controllers/backup.js index ce0cba754..e2c85231a 100644 --- a/src/js/controllers/backup.js +++ b/src/js/controllers/backup.js @@ -95,7 +95,10 @@ angular.module('copayApp.controllers').controller('backupController', if (val) { confirmBackupPopup.close(); if ($stateParams.fromOnboarding) $state.go('onboarding.disclaimer'); - else $state.go('tabs.home') + else { + $ionicHistory.clearHistory(); + $state.go('tabs.home'); + } } else { confirmBackupPopup.close(); $scope.goToStep(1); diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 6393fdc3f..06560a31b 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,11 +1,27 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $timeout, $log, $ionicModal, $ionicHistory, configService, profileService, $state, addressService, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { - + function($scope, $timeout, $log, $ionicModal, $ionicHistory, platformInfo, configService, profileService, $state, addressService, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { var wallet = profileService.getWallet($stateParams.walletId); var rawTx; + $scope.init = function() { + $scope.wallet = wallet; + $scope.isCordova = platformInfo.isCordova; + $scope.needsBackup = wallet.needsBackup; + $scope.walletAlias = wallet.name; + $scope.walletName = wallet.credentials.walletName; + $scope.formData = {}; + $scope.formData.inputData = null; + $scope.scannedKey = null; + $scope.balance = null; + $scope.balanceSat = null; + $scope.scanned = false; + $timeout(function() { + $scope.$apply(); + }, 10); + }; + $scope.onQrCodeScanned = function(data) { - $scope.inputData = data; + $scope.formData.inputData = data; $scope.onData(data); }; @@ -62,6 +78,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', $scope.balanceSat = balance; var config = configService.getSync().wallet.settings; $scope.balance = txFormatService.formatAmount(balance) + ' ' + config.unitName; + $scope.scanned = true; } $scope.$apply(); @@ -125,5 +142,4 @@ angular.module('copayApp.controllers').controller('paperWalletController', $scope.txStatusModal.show(); }); }; - }); diff --git a/src/js/controllers/preferencesAdvancedController.js b/src/js/controllers/preferencesAdvancedController.js new file mode 100644 index 000000000..0af8cf258 --- /dev/null +++ b/src/js/controllers/preferencesAdvancedController.js @@ -0,0 +1,10 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('preferencesAdvancedController', function($scope, $timeout, $stateParams, profileService) { + var wallet = profileService.getWallet($stateParams.walletId); + $scope.network = wallet.network; + + $timeout(function() { + $scope.$apply(); + }, 1); +}); From ee99c0360252c19362a86068ef9b473512c6cb5f Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 8 Sep 2016 19:58:00 -0300 Subject: [PATCH 04/23] handle errors --- src/js/controllers/paperWallet.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 06560a31b..64e6b6176 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,5 +1,5 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $timeout, $log, $ionicModal, $ionicHistory, platformInfo, configService, profileService, $state, addressService, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { + function($scope, $timeout, $log, $ionicModal, $ionicHistory, popupService, gettextCatalog, platformInfo, configService, profileService, $state, addressService, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { var wallet = profileService.getWallet($stateParams.walletId); var rawTx; @@ -26,7 +26,6 @@ angular.module('copayApp.controllers').controller('paperWalletController', }; $scope.onData = function(data) { - $scope.error = null; $scope.scannedKey = data; $scope.isPkEncrypted = (data.substring(0, 2) == '6P'); }; @@ -64,7 +63,6 @@ angular.module('copayApp.controllers').controller('paperWalletController', $scope.scanFunds = function() { $scope.privateKey = ''; $scope.balanceSat = 0; - $scope.error = null; ongoingProcess.set('scanning', true); $timeout(function() { @@ -72,7 +70,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', ongoingProcess.set('scanning', false); if (err) { $log.error(err); - $scope.error = err.message || err.toString(); + popupService.showAlert(gettextCatalog.getString('Error scanning funds:'), err || err.toString()); } else { $scope.privateKey = privateKey; $scope.balanceSat = balance; @@ -107,15 +105,14 @@ angular.module('copayApp.controllers').controller('paperWalletController', $scope.sweepWallet = function() { ongoingProcess.set('sweepingWallet', true); $scope.sending = true; - $scope.error = null; $timeout(function() { _sweepWallet(function(err, destinationAddress, txid) { ongoingProcess.set('sweepingWallet', false); if (err) { - $scope.error = err.message || err.toString(); $log.error(err); + popupService.showAlert(gettextCatalog.getString('Error sweeping wallet:'), err || err.toString()); } else { var type = walletService.getViewStatus(wallet, txp); $scope.openStatusModal(type, txp, function() { From be927da487e0487167199163714fd78a61d1b510 Mon Sep 17 00:00:00 2001 From: Jamal Jackson Date: Fri, 9 Sep 2016 09:47:53 -0400 Subject: [PATCH 05/23] fixed backup request view for iPhone5 size devices --- public/views/onboarding/backupRequest.html | 14 ++++---- .../onboarding/onboard-backup-request.scss | 35 +++++++++++++++++++ 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/public/views/onboarding/backupRequest.html b/public/views/onboarding/backupRequest.html index f7099033f..0284f8bdf 100644 --- a/public/views/onboarding/backupRequest.html +++ b/public/views/onboarding/backupRequest.html @@ -16,12 +16,14 @@
-
- -
-
- +
+
+ +
+
+ +
diff --git a/src/sass/views/onboarding/onboard-backup-request.scss b/src/sass/views/onboarding/onboard-backup-request.scss index 0ad4d641d..ee4358655 100644 --- a/src/sass/views/onboarding/onboard-backup-request.scss +++ b/src/sass/views/onboarding/onboard-backup-request.scss @@ -8,4 +8,39 @@ #arrow-down{ font-size: 4.2rem; } + .cta-buttons{ + width:100%; + float:left; + position: relative; + } +} + +@media (max-width: 400px){ + #onboarding-backup-request{ + .warning{ + margin: 2rem auto 1rem; + height: 8rem; + } + h3{ + font-size:1.3rem; + } + p{ + font-size:.9rem; + max-width: 80%; + flex: 0 0 80%; + } + .cta-buttons{ + float:none; + bottom:0; + position: absolute; + } + } +} +@media (max-height: 540px){ + #onboarding-backup-request{ + .cta-buttons{ + float:left; + position: relative; + } + } } \ No newline at end of file From 3af5405340b7d24aebffbf3aa153a7d8fa947489 Mon Sep 17 00:00:00 2001 From: Jamal Jackson Date: Fri, 9 Sep 2016 10:05:35 -0400 Subject: [PATCH 06/23] cleaned up backup warning view on iPhone5 --- public/views/onboarding/backupWarning.html | 6 +-- .../onboarding/onboard-backup-warning.scss | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/public/views/onboarding/backupWarning.html b/public/views/onboarding/backupWarning.html index d3406fb13..19f21d0ac 100644 --- a/public/views/onboarding/backupWarning.html +++ b/public/views/onboarding/backupWarning.html @@ -8,7 +8,7 @@
-

+

Are you being watched?

@@ -18,14 +18,14 @@

- +

Anyone with your backup phrase can access or spend your bitcoin.

-
+
diff --git a/src/sass/views/onboarding/onboard-backup-warning.scss b/src/sass/views/onboarding/onboard-backup-warning.scss index 0ee7b5c1b..860c341ed 100644 --- a/src/sass/views/onboarding/onboard-backup-warning.scss +++ b/src/sass/views/onboarding/onboard-backup-warning.scss @@ -8,4 +8,41 @@ #arrow-down{ font-size: 4.2rem; } + .cta-buttons{ + float:left; + width:100%; + } +} + +@media (max-width: 400px){ + #onboarding-backup-warning{ + .warning{ + margin: 2rem auto 1rem; + height: 8rem; + } + h3{ + font-size:1.3rem; + } + p{ + font-size:.9rem; + max-width: 80%; + flex: 0 0 80%; + } + .warning-image{ + height: 11rem; + } + .cta-buttons{ + float:none; + bottom:46px; + position: absolute; + } + } +} +@media (max-height: 540px){ + #onboarding-backup-warning{ + .cta-buttons{ + float:left; + position: relative; + } + } } \ No newline at end of file From 44815fa8eef47e74402704c0e72d297aeff34969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 9 Sep 2016 11:54:02 -0300 Subject: [PATCH 07/23] persist state if force quit app --- src/js/routes.js | 22 +++++++++++++++++----- src/js/services/storageService.js | 7 +++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/js/routes.js b/src/js/routes.js index e37d8efa2..d7b78544f 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -726,7 +726,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }); }) - .run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService) { + .run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService) { uxLanguage.init(); openURLService.init(); @@ -782,10 +782,19 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr if (err) { if (err.message && err.message.match('NOPROFILE')) { $log.debug('No profile... redirecting'); - $state.transitionTo('onboarding.welcome'); + $state.go('onboarding.welcome'); } else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) { $log.debug('Display disclaimer... redirecting'); - $state.transitionTo('onboarding.disclaimer'); + storageService.getLastState(function(err, state) { + if (err && !state) { + $log.error(err); + $state.go('onboarding.disclaimer'); + } + else { + var state = JSON.parse(state); + $state.go(state.name, state.toParams); + } + }) } else { throw new Error(err); // TODO } @@ -793,7 +802,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr profileService.storeProfileIfDirty(); $log.debug('Profile loaded ... Starting UX.'); - $state.transitionTo('tabs.home'); + $state.go('tabs.home'); } }); }); @@ -816,6 +825,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr $log.debug('Route change from:', fromState.name || '-', ' to:', toState.name); $log.debug(' toParams:' + JSON.stringify(toParams || {})); $log.debug(' fromParams:' + JSON.stringify(fromParams || {})); - + var state = {}; + state.name = toState.name; + state.toParams = toParams; + storageService.setLastState(JSON.stringify(state), function() {}); }); }); diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index a498dfb89..706e59d4f 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -276,6 +276,13 @@ angular.module('copayApp.services') storage.remove('nextStep-' + service, cb); }; + root.setLastState = function(state, toParams, cb) { + storage.set('lastState', state, toParams, cb); + }; + + root.getLastState = function(cb) { + storage.get('lastState', cb); + }; root.checkQuota = function() { var block = ''; From 1c35cf5e819b4dfb3698e1c8f741eb0457e200ae Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 9 Sep 2016 13:03:58 -0300 Subject: [PATCH 08/23] show status modal after sweep --- src/js/controllers/paperWallet.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 64e6b6176..27c784d2f 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,5 +1,5 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $timeout, $log, $ionicModal, $ionicHistory, popupService, gettextCatalog, platformInfo, configService, profileService, $state, addressService, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { + function($scope, $timeout, $log, $ionicModal, $ionicHistory, popupService, gettextCatalog, platformInfo, configService, profileService, $state, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { var wallet = profileService.getWallet($stateParams.walletId); var rawTx; @@ -85,7 +85,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', }; function _sweepWallet(cb) { - addressService.getAddress(wallet.credentials.walletId, true, function(err, destinationAddress) { + walletService.getAddress(wallet, true, function(err, destinationAddress) { if (err) return cb(err); wallet.buildTxFromPrivateKey($scope.privateKey, destinationAddress, null, function(err, tx) { @@ -109,13 +109,12 @@ angular.module('copayApp.controllers').controller('paperWalletController', $timeout(function() { _sweepWallet(function(err, destinationAddress, txid) { ongoingProcess.set('sweepingWallet', false); - + $scope.sending = false; if (err) { $log.error(err); popupService.showAlert(gettextCatalog.getString('Error sweeping wallet:'), err || err.toString()); } else { - var type = walletService.getViewStatus(wallet, txp); - $scope.openStatusModal(type, txp, function() { + $scope.openStatusModal('broadcasted', function() { $ionicHistory.clearHistory(); $state.go('tabs.home'); }); @@ -125,15 +124,15 @@ angular.module('copayApp.controllers').controller('paperWalletController', }, 100); }; - $scope.openStatusModal = function(type, txp, cb) { + $scope.openStatusModal = function(type, cb) { + $scope.tx = {}; + $scope.tx.amountStr = $scope.balance; $scope.type = type; - $scope.tx = txFormatService.processTx(txp); $scope.color = wallet.backgroundColor; $scope.cb = cb; $ionicModal.fromTemplateUrl('views/modals/tx-status.html', { - scope: $scope, - animation: 'slide-in-up' + scope: $scope }).then(function(modal) { $scope.txStatusModal = modal; $scope.txStatusModal.show(); From 91a216cf0dbc5e7826ba24d7f461ccdf4ff3567a Mon Sep 17 00:00:00 2001 From: Jamal Jackson Date: Fri, 9 Sep 2016 13:47:27 -0400 Subject: [PATCH 09/23] onboarding backup desktop stylings updates --- public/views/onboarding/tour.html | 8 +++---- .../onboarding/onboard-backup-request.scss | 15 ++++++++++-- .../onboarding/onboard-backup-warning.scss | 7 +++++- .../onboarding/onboard-collect-email.scss | 13 +++++++++++ src/sass/views/onboarding/onboard-tour.scss | 23 +++++++++++++++++++ 5 files changed, 59 insertions(+), 7 deletions(-) diff --git a/public/views/onboarding/tour.html b/public/views/onboarding/tour.html index 8df77f256..d4be4de4a 100644 --- a/public/views/onboarding/tour.html +++ b/public/views/onboarding/tour.html @@ -30,7 +30,7 @@ Just scan the code to pay

-
+
@@ -54,9 +54,9 @@ The exchange rate changes with the market

-
+
@@ -78,7 +78,7 @@ Not even BitPay can access it

-
+
diff --git a/src/sass/views/onboarding/onboard-backup-request.scss b/src/sass/views/onboarding/onboard-backup-request.scss index ee4358655..8ed5a36d8 100644 --- a/src/sass/views/onboarding/onboard-backup-request.scss +++ b/src/sass/views/onboarding/onboard-backup-request.scss @@ -10,8 +10,9 @@ } .cta-buttons{ width:100%; - float:left; - position: relative; + float:none; + position: absolute; + bottom: 0; } } @@ -33,6 +34,9 @@ float:none; bottom:0; position: absolute; + button{ + max-width: 400px; + } } } } @@ -43,4 +47,11 @@ position: relative; } } +} +@media (min-height: 980px){ + #onboarding-backup-request{ + #arrow-down{ + margin-top: 15rem; + } + } } \ No newline at end of file diff --git a/src/sass/views/onboarding/onboard-backup-warning.scss b/src/sass/views/onboarding/onboard-backup-warning.scss index 860c341ed..7eaeacbca 100644 --- a/src/sass/views/onboarding/onboard-backup-warning.scss +++ b/src/sass/views/onboarding/onboard-backup-warning.scss @@ -9,8 +9,13 @@ font-size: 4.2rem; } .cta-buttons{ - float:left; + float:none; + bottom:46px; + position: absolute; width:100%; + button{ + max-width: 400px; + } } } diff --git a/src/sass/views/onboarding/onboard-collect-email.scss b/src/sass/views/onboarding/onboard-collect-email.scss index 125d21a93..3cc60ce01 100644 --- a/src/sass/views/onboarding/onboard-collect-email.scss +++ b/src/sass/views/onboarding/onboard-collect-email.scss @@ -64,6 +64,19 @@ } } } +@media (min-width: 1000px){ + #onboarding-collect-email{ + #collect-email{ + p, form{ + max-width: 600px; + @include center-block(); + } + form{ + margin-top:.5rem; + } + } + } +} @keyframes topBottom { 0% { diff --git a/src/sass/views/onboarding/onboard-tour.scss b/src/sass/views/onboarding/onboard-tour.scss index ddb13b75e..b955d6c53 100644 --- a/src/sass/views/onboarding/onboard-tour.scss +++ b/src/sass/views/onboarding/onboard-tour.scss @@ -23,6 +23,10 @@ background-position: top; } } + .cta-button{ + position: absolute; + bottom: 85px; + } } @media (max-width: 400px){ @@ -34,3 +38,22 @@ } } } + +@media (min-width: 1000px){ + #onboard-tour{ + p, h2, h3{ + max-width: 600px; + } + button{ + max-width: 400px; + } + #cta{ + margin: 2rem 0 0; + } + &-control{ + #cta{ + margin-bottom: 2rem; + } + } + } +} From ae1cdf4d03d2ed57b9b9f18bf8716a6d2220a43f Mon Sep 17 00:00:00 2001 From: Jamal Jackson Date: Fri, 9 Sep 2016 14:01:39 -0400 Subject: [PATCH 10/23] added global max-width to on boarding view --- src/sass/views/onboarding/onboarding.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sass/views/onboarding/onboarding.scss b/src/sass/views/onboarding/onboarding.scss index 0c5522ac3..c84b0e3df 100644 --- a/src/sass/views/onboarding/onboarding.scss +++ b/src/sass/views/onboarding/onboarding.scss @@ -81,6 +81,12 @@ h2{ font-size: 1.2rem; } + p,h2,h3{ + max-width: 600px !important; + } + button{ + max-width: 400px !important; + } } } } From 46a3a9871f3ced1c7e6a3ee2046065ec3d8ce011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 9 Sep 2016 16:23:05 -0300 Subject: [PATCH 11/23] fix transitions with android hardware button --- src/js/routes.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/js/routes.js b/src/js/routes.js index e37d8efa2..48c38d29c 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -741,19 +741,23 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr $ionicPlatform.registerBackButtonAction(function(e) { - var fromDisclaimer = $ionicHistory.currentStateName().match(/disclaimer/) ? 'true' : ''; - var fromTabs = $ionicHistory.currentStateName().match(/tabs/) ? 'true' : ''; + var fromWelcome = $ionicHistory.currentStateName().match(/welcome/) ? true : false; + var matchHome = $ionicHistory.currentStateName().match(/home/) ? true : false; + var matchReceive = $ionicHistory.currentStateName().match(/receive/) ? true : false; + var matchSend = $ionicHistory.currentStateName().match(/send/) ? true : false; + var matchSettings = $ionicHistory.currentStateName().match(/settings/) ? true : false; + var fromTabs = matchHome | matchReceive | matchSend | matchSettings; - if ($rootScope.backButtonPressedOnceToExit || fromDisclaimer) { - ionic.Platform.exitApp(); - } else if ($ionicHistory.backView() && !fromTabs) { + if ($ionicHistory.backView() && !fromTabs) { $ionicHistory.goBack(); + } else if ($rootScope.backButtonPressedOnceToExit || fromWelcome) { + ionic.Platform.exitApp(); } else { $rootScope.backButtonPressedOnceToExit = true; window.plugins.toast.showShortBottom(gettextCatalog.getString('Press again to exit')); - setInterval(function() { + $timeout(function() { $rootScope.backButtonPressedOnceToExit = false; - }, 5000); + }, 3000); } e.preventDefault(); }, 101); From 32d99e3e36a83709f28674989705ab30cab1c519 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 12 Sep 2016 11:57:20 -0300 Subject: [PATCH 12/23] Addressbook as a view (not modal) --- public/views/addressbook.add.html | 63 +++++++++++++ public/views/addressbook.html | 52 +++++++++++ public/views/addressbook.view.html | 36 ++++++++ public/views/modals/addressbook.html | 96 -------------------- public/views/tab-send.html | 4 +- public/views/tab-settings.html | 3 +- src/js/controllers/addressbook.js | 56 ++++++++++++ src/js/controllers/addressbookAdd.js | 36 ++++++++ src/js/controllers/addressbookView.js | 37 ++++++++ src/js/controllers/modals/addressbook.js | 111 ----------------------- src/js/controllers/tab-send.js | 11 +-- src/js/controllers/tab-settings.js | 13 +-- src/js/routes.js | 35 +++++++ src/js/services/addressbookService.js | 14 ++- 14 files changed, 330 insertions(+), 237 deletions(-) create mode 100644 public/views/addressbook.add.html create mode 100644 public/views/addressbook.html create mode 100644 public/views/addressbook.view.html delete mode 100644 public/views/modals/addressbook.html create mode 100644 src/js/controllers/addressbook.js create mode 100644 src/js/controllers/addressbookAdd.js create mode 100644 src/js/controllers/addressbookView.js delete mode 100644 src/js/controllers/modals/addressbook.js diff --git a/public/views/addressbook.add.html b/public/views/addressbook.add.html new file mode 100644 index 000000000..c5b3762fe --- /dev/null +++ b/public/views/addressbook.add.html @@ -0,0 +1,63 @@ + + + + + + + Add entry + + + + + +
+ +
+ + + +
+ +
+ +
+ +
+
+
diff --git a/public/views/addressbook.html b/public/views/addressbook.html new file mode 100644 index 000000000..3c4374150 --- /dev/null +++ b/public/views/addressbook.html @@ -0,0 +1,52 @@ + + + + + + + Addressbook + + + + + + + + +
+ +
+ + + + + {{addrEntry.name}} + + + + + + + + + + +
+
diff --git a/public/views/addressbook.view.html b/public/views/addressbook.view.html new file mode 100644 index 000000000..00b191e7f --- /dev/null +++ b/public/views/addressbook.view.html @@ -0,0 +1,36 @@ + + + + + + + Addressbook + + + + + +
+
+

Name

+ {{addressbookEntry.name}} +
+
+

Email

+ {{addressbookEntry.email}} +
+
+

Address

+ {{addressbookEntry.address}} +
+
+ + + +
+
diff --git a/public/views/modals/addressbook.html b/public/views/modals/addressbook.html deleted file mode 100644 index e6a434a8c..000000000 --- a/public/views/modals/addressbook.html +++ /dev/null @@ -1,96 +0,0 @@ - - - -
- Addressbook - Add entry -
- -
- - - -
- -
- -
- - - -

{{addrEntry.label}}

-

{{addrEntry.address}}

- - - - - -
- - -
- -
- -
- - - - -
- -
- -
- -
-
-
diff --git a/public/views/tab-send.html b/public/views/tab-send.html index a230be863..ace36d6fd 100644 --- a/public/views/tab-send.html +++ b/public/views/tab-send.html @@ -17,9 +17,9 @@
-
+
Contacts & Wallets - +
No Wallet - Contact
diff --git a/public/views/tab-settings.html b/public/views/tab-settings.html index 92276b712..43827c659 100644 --- a/public/views/tab-settings.html +++ b/public/views/tab-settings.html @@ -6,9 +6,10 @@
-
+ Address Book +
Preferences
diff --git a/src/js/controllers/addressbook.js b/src/js/controllers/addressbook.js new file mode 100644 index 000000000..d9e136901 --- /dev/null +++ b/src/js/controllers/addressbook.js @@ -0,0 +1,56 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('addressbookListController', function($scope, $log, $timeout, addressbookService, lodash, popupService) { + + var contacts; + + $scope.initAddressbook = function() { + addressbookService.list(function(err, ab) { + if (err) $log.error(err); + + $scope.isEmptyList = lodash.isEmpty(ab); + + contacts = []; + lodash.each(ab, function(v, k) { + contacts.push({ + name: lodash.isObject(v) ? v.name : v, + address: k, + email: lodash.isObject(v) ? v.email : null + }); + }); + + $scope.addressbook = lodash.clone(contacts); + }); + }; + + $scope.findAddressbook = function(search) { + if (!search || search.length < 2) { + $scope.addressbook = contacts; + $timeout(function() { + $scope.$apply(); + }, 10); + return; + } + + var result = lodash.filter(contacts, function(item) { + var val = item.name; + return lodash.includes(val.toLowerCase(), search.toLowerCase()); + }); + + $scope.addressbook = result; + }; + + $scope.remove = function(addr) { + $timeout(function() { + addressbookService.remove(addr, function(err, ab) { + if (err) { + popupService.showAlert(err); + return; + } + $scope.initAddressbook(); + $scope.$digest(); + }); + }, 100); + }; + +}); diff --git a/src/js/controllers/addressbookAdd.js b/src/js/controllers/addressbookAdd.js new file mode 100644 index 000000000..8d6831076 --- /dev/null +++ b/src/js/controllers/addressbookAdd.js @@ -0,0 +1,36 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('addressbookAddController', function($scope, $state, $timeout, addressbookService, popupService) { + + $scope.addressbookEntry = { + 'address': '', + 'name': '', + 'email': '' + }; + + $scope.onQrCodeScanned = function(data, addressbookForm) { + $timeout(function() { + var form = addressbookForm; + if (data && form) { + data = data.replace('bitcoin:', ''); + form.address.$setViewValue(data); + form.address.$isValid = true; + form.address.$render(); + } + $scope.$digest(); + }, 100); + }; + + $scope.add = function(addressbook) { + $timeout(function() { + addressbookService.add(addressbook, function(err, ab) { + if (err) { + popupService.showAlert(err); + return; + } + $state.go('tabs.addressbook'); + }); + }, 100); + }; + +}); diff --git a/src/js/controllers/addressbookView.js b/src/js/controllers/addressbookView.js new file mode 100644 index 000000000..a0064fad4 --- /dev/null +++ b/src/js/controllers/addressbookView.js @@ -0,0 +1,37 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('addressbookViewController', function($scope, $state, $timeout, $stateParams, lodash, addressbookService, popupService) { + + var address = $stateParams.address; + + if (!address) { + $state.go('tabs.addressbook'); + return; + } + + addressbookService.get(address, function(err, obj) { + if (err) { + popupService.showAlert(err); + return; + } + if (!lodash.isObject(obj)) { + var name = obj; + obj = { + 'name': name, + 'address': address, + 'email': '' + }; + } + $scope.addressbookEntry = obj; + }); + + $scope.sendTo = function() { + $timeout(function() { + $state.transitionTo('send.amount', { + toAddress: $scope.addressbookEntry.address, + toName: $scope.addressbookEntry.name + }); + }, 100); + }; + +}); diff --git a/src/js/controllers/modals/addressbook.js b/src/js/controllers/modals/addressbook.js deleted file mode 100644 index ee63c7e75..000000000 --- a/src/js/controllers/modals/addressbook.js +++ /dev/null @@ -1,111 +0,0 @@ -'use strict'; - -angular.module('copayApp.controllers').controller('addressbookModalController', function($scope, $log, $state, $timeout, $ionicPopup, addressbookService, lodash, popupService) { - - var contacts; - - $scope.initAddressbook = function() { - addressbookService.list(function(err, ab) { - if (err) $log.error(err); - - $scope.isEmptyList = lodash.isEmpty(ab); - - contacts = []; - lodash.each(ab, function(v, k) { - contacts.push({ - label: v, - address: k - }); - }); - - $scope.addressbook = lodash.clone(contacts); - }); - }; - - $scope.findAddressbook = function(search) { - if (!search || search.length < 2) { - $scope.addressbook = contacts; - $timeout(function() { - $scope.$apply(); - }, 10); - return; - } - - var result = lodash.filter(contacts, function(item) { - var val = item.label; - return lodash.includes(val.toLowerCase(), search.toLowerCase()); - }); - - $scope.addressbook = result; - }; - - $scope.sendTo = function(item) { - $scope.closeAddressbookModal(); - $timeout(function() { - $state.transitionTo('send.amount', { toAddress: item.address, toName: item.label}) - }, 100); - }; - - $scope.closeAddressbookModal = function() { - $scope.cleanAddressbookEntry(); - $scope.addAddressbookEntry = false; - $scope.addressbookModal.hide(); - }; - - $scope.onQrCodeScanned = function(data, addressbookForm) { - $timeout(function() { - var form = addressbookForm; - if (data && form) { - data = data.replace('bitcoin:', ''); - form.address.$setViewValue(data); - form.address.$isValid = true; - form.address.$render(); - } - $scope.$digest(); - }, 100); - }; - - $scope.cleanAddressbookEntry = function() { - $scope.addressbookEntry = { - 'address': '', - 'label': '' - }; - }; - - $scope.toggleAddAddressbookEntry = function() { - $scope.cleanAddressbookEntry(); - $scope.addAddressbookEntry = !$scope.addAddressbookEntry; - }; - - $scope.add = function(addressbook) { - $timeout(function() { - addressbookService.add(addressbook, function(err, ab) { - if (err) { - popupService.showAlert(err); - return; - } - $scope.initAddressbook(); - $scope.toggleAddAddressbookEntry(); - $scope.$digest(); - }); - }, 100); - }; - - $scope.remove = function(addr) { - $timeout(function() { - addressbookService.remove(addr, function(err, ab) { - if (err) { - popupService.showAlert(err); - return; - } - $scope.initAddressbook(); - $scope.$digest(); - }); - }, 100); - }; - - $scope.$on('$destroy', function() { - $scope.addressbookModal.remove(); - }); - -}); diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index ae2d6ceeb..92d691f8d 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, $ionicModal, $log, $timeout, addressbookService, profileService, lodash, $state, walletService, incomingData) { +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, addressbookService, profileService, lodash, $state, walletService, incomingData ) { var originalList; @@ -81,15 +81,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }); }; - $scope.openAddressbookModal = function() { - $ionicModal.fromTemplateUrl('views/modals/addressbook.html', { - scope: $scope - }).then(function(modal) { - $scope.addressbookModal = modal; - $scope.addressbookModal.show(); - }); - }; - $scope.$on('modal.hidden', function() { $scope.init(); }); diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js index e4ce0e833..b779d5f87 100644 --- a/src/js/controllers/tab-settings.js +++ b/src/js/controllers/tab-settings.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $rootScope, $log, $ionicModal, $window, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) { +angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $rootScope, $log, $window, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) { $scope.init = function() { @@ -38,17 +38,6 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct $scope.wallets = profileService.getWallets(); }; - $scope.openAddressbookModal = function() { - - $ionicModal.fromTemplateUrl('views/modals/addressbook.html', { - scope: $scope - }).then(function(modal) { - $scope.addressbookModal = modal; - $scope.addressbookModal.show(); - }); - }; - - $scope.openSettings = function() { cordova.plugins.diagnostic.switchToSettings(function() { $log.debug('switched to settings'); diff --git a/src/js/routes.js b/src/js/routes.js index e37d8efa2..49cd93a2f 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -490,6 +490,41 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) + /* + * + * Addressbook + * + */ + + + .state('tabs.addressbook', { + url: '/addressbook', + views: { + 'tab-settings': { + templateUrl: 'views/addressbook.html', + controller: 'addressbookListController' + } + } + }) + .state('tabs.addressbook.add', { + url: '/addressbook/add', + views: { + 'tab-settings@tabs': { + templateUrl: 'views/addressbook.add.html', + controller: 'addressbookAddController' + } + } + }) + .state('tabs.addressbook.view', { + url: '/addressbook/view/:address', + views: { + 'tab-settings@tabs': { + templateUrl: 'views/addressbook.view.html', + controller: 'addressbookViewController' + } + } + }) + /* * *TO DO diff --git a/src/js/services/addressbookService.js b/src/js/services/addressbookService.js index 74fe7edcc..edd3237d1 100644 --- a/src/js/services/addressbookService.js +++ b/src/js/services/addressbookService.js @@ -3,12 +3,16 @@ angular.module('copayApp.services').factory('addressbookService', function(bitcore, storageService, lodash) { var root = {}; - root.getLabel = function(addr, cb) { + root.get = function(addr, cb) { storageService.getAddressbook('testnet', function(err, ab) { - if (ab && ab[addr]) return cb(ab[addr]); + if (err) return cb(err); + if (ab) ab = JSON.parse(ab); + if (ab && ab[addr]) return cb(null, ab[addr]); - storageService.getAddressbook('livnet', function(err, ab) { - if (ab && ab[addr]) return cb(ab[addr]); + storageService.getAddressbook('livenet', function(err, ab) { + if (err) return cb(err); + if (ab) ab = JSON.parse(ab); + if (ab && ab[addr]) return cb(null, ab[addr]); return cb(); }); }); @@ -38,7 +42,7 @@ angular.module('copayApp.services').factory('addressbookService', function(bitco ab = ab || {}; if (lodash.isArray(ab)) ab = {}; // No array if (ab[entry.address]) return cb('Entry already exist'); - ab[entry.address] = entry.label; + ab[entry.address] = entry; storageService.setAddressbook(network, JSON.stringify(ab), function(err, ab) { if (err) return cb('Error adding new entry'); root.list(function(err, ab) { From b4b06f393b0fc71633401de4ee1c83b0a9bb693d Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 12 Sep 2016 12:19:08 -0300 Subject: [PATCH 13/23] Fix route --- src/js/routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/routes.js b/src/js/routes.js index 49cd93a2f..deff1dd82 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -507,7 +507,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('tabs.addressbook.add', { - url: '/addressbook/add', + url: '/add', views: { 'tab-settings@tabs': { templateUrl: 'views/addressbook.add.html', @@ -516,7 +516,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('tabs.addressbook.view', { - url: '/addressbook/view/:address', + url: '/view/:address', views: { 'tab-settings@tabs': { templateUrl: 'views/addressbook.view.html', From d28c837fcf333f00f2c9d6ad7389b462712cf4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 9 Sep 2016 11:14:04 -0300 Subject: [PATCH 14/23] onboarding process details --- public/views/includes/confirmBackupPopup.html | 14 +---- public/views/onboarding/collectEmail.html | 53 +++++++++++++------ src/js/controllers/backup.js | 31 ++++++----- .../controllers/onboarding/backupRequest.js | 32 ++++++----- src/js/controllers/onboarding/collectEmail.js | 33 ++++++++---- src/js/services/popupService.js | 27 ++++++---- .../onboarding/onboard-collect-email.scss | 40 ++++++-------- 7 files changed, 133 insertions(+), 97 deletions(-) diff --git a/public/views/includes/confirmBackupPopup.html b/public/views/includes/confirmBackupPopup.html index 5dc2d2eeb..c77308c05 100644 --- a/public/views/includes/confirmBackupPopup.html +++ b/public/views/includes/confirmBackupPopup.html @@ -1,19 +1,9 @@ -
+
Your bitcoin wallet is backed up!

Be sure to store your recovery phrase in a secure place. If this app is deelted, you money coont be recovered with out it.

-
-
uh oh...
-

It's importante that you write your backup phrase down correctly. If something happens to your wallet, you'll need this backup to recover your money - Please review your backup and try again

- -
diff --git a/public/views/onboarding/collectEmail.html b/public/views/onboarding/collectEmail.html index 5629d5c8c..a63f2c652 100644 --- a/public/views/onboarding/collectEmail.html +++ b/public/views/onboarding/collectEmail.html @@ -1,11 +1,4 @@ - - - - -
@@ -14,16 +7,42 @@

Wallet Created

-
-

Where would you like to receive email notifications about payments?

+
+
+

Where would you like to receive email notifications about payments?

+
+
+ +
+
+
+
+

Is this email address correct?

+
+
+

{{email}}

+
+
+
+ +
+
+ +
+
+
+
+
+
-
- -
-
-
diff --git a/src/js/controllers/backup.js b/src/js/controllers/backup.js index de6f258a9..681ffd081 100644 --- a/src/js/controllers/backup.js +++ b/src/js/controllers/backup.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('backupController', - function($rootScope, $scope, $timeout, $log, $state, $stateParams, $ionicPopup, $ionicNavBarDelegate, uxLanguage, lodash, fingerprintService, platformInfo, configService, profileService, bwcService, walletService, ongoingProcess, storageService) { + function($rootScope, $scope, $timeout, $log, $state, $stateParams, $ionicPopup, $ionicNavBarDelegate, uxLanguage, lodash, fingerprintService, platformInfo, configService, profileService, bwcService, walletService, ongoingProcess, storageService, popupService, gettextCatalog) { var wallet = profileService.getWallet($stateParams.walletId); $ionicNavBarDelegate.title(wallet.credentials.walletName); $scope.n = wallet.n; @@ -87,24 +87,29 @@ angular.module('copayApp.controllers').controller('backupController', }; var openPopup = function() { - var confirmBackupPopup = $ionicPopup.show({ - templateUrl: "views/includes/confirmBackupPopup.html", - scope: $scope, - }); - $scope.closePopup = function(val) { - if (val) { + if ($scope.backupError) { + var title = gettextCatalog.getString('uh oh...'); + var message = gettextCatalog.getString("It's importante that you write your backup phrase down correctly. If something happens to your wallet, you'll need this backup to recover your money Please review your backup and try again"); + popupService.showAlert(title, message, function() { + $scope.goToStep(1); + }) + } + else { + var confirmBackupPopup = $ionicPopup.show({ + templateUrl: "views/includes/confirmBackupPopup.html", + scope: $scope, + }); + + $scope.closePopup = function() { confirmBackupPopup.close(); if ($stateParams.fromOnboarding) $state.go('onboarding.disclaimer'); else { $ionicHistory.clearHistory(); - $state.go('tabs.home'); + $state.go('tabs.home') } - } else { - confirmBackupPopup.close(); - $scope.goToStep(1); - } - }; + }; + } } var confirm = function(cb) { diff --git a/src/js/controllers/onboarding/backupRequest.js b/src/js/controllers/onboarding/backupRequest.js index 8284baafb..01fcfcfcd 100644 --- a/src/js/controllers/onboarding/backupRequest.js +++ b/src/js/controllers/onboarding/backupRequest.js @@ -1,22 +1,28 @@ 'use strict'; -angular.module('copayApp.controllers').controller('backupRequestController', function($scope, $state, $stateParams, $ionicPopup) { +angular.module('copayApp.controllers').controller('backupRequestController', function($scope, $state, $stateParams, $ionicPopup, popupService, gettextCatalog) { $scope.walletId = $stateParams.walletId; + $scope.openPopup = function() { - var backupLaterPopup = $ionicPopup.show({ - templateUrl: "views/includes/backupLaterPopup.html", - scope: $scope, + + var title = gettextCatalog.getString('Without a backup, you could lose money'); + var message = gettextCatalog.getString('If something happens to this device, this app is deleted, or your password forgotten, neither you nor Bitpay can recover your funds'); + var okText = gettextCatalog.getString('I understand'); + var cancelText = gettextCatalog.getString('Go back'); + popupService.showConfirm(title, message, okText, cancelText, function(val) { + if (val) { + var title = gettextCatalog.getString('Are you sure you want to skip the backup?'); + var message = gettextCatalog.getString('You can create a backup later from your wallet settings'); + var okText = gettextCatalog.getString('Yes, skip backup'); + var cancelText = gettextCatalog.getString('Go back'); + popupService.showConfirm(title, message, okText, cancelText, function(val) { + if (val) { + $state.go('onboarding.disclaimer'); + } + }); + } }); - - $scope.goBack = function() { - backupLaterPopup.close(); - }; - - $scope.continue = function() { - backupLaterPopup.close(); - $state.go('onboarding.disclaimer'); - }; } }); diff --git a/src/js/controllers/onboarding/collectEmail.js b/src/js/controllers/onboarding/collectEmail.js index 8fcda40f5..6479e0ea8 100644 --- a/src/js/controllers/onboarding/collectEmail.js +++ b/src/js/controllers/onboarding/collectEmail.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $stateParams, profileService, configService, walletService, platformInfo) { +angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $timeout, $stateParams, profileService, configService, walletService, platformInfo) { var isCordova = platformInfo.isCordova; var isWP = platformInfo.isWP; @@ -9,11 +9,7 @@ angular.module('copayApp.controllers').controller('collectEmailController', func var wallet = profileService.getWallet($stateParams.walletId); var walletId = wallet.credentials.walletId; - var config = configService.getSync(); - config.emailFor = config.emailFor || {}; - $scope.email = config.emailFor && config.emailFor[walletId]; - - $scope.save = function(form) { + $scope.save = function() { var opts = { emailFor: {} }; @@ -25,13 +21,32 @@ angular.module('copayApp.controllers').controller('collectEmailController', func if (err) $log.warn(err); configService.set(opts, function(err) { if (err) $log.warn(err); - if (!usePushNotifications) $state.go('onboarding.backupRequest', {walletId: walletId}); - else $state.go('onboarding.notifications', {walletId: walletId}); + if (!usePushNotifications) $state.go('onboarding.backupRequest', { + walletId: walletId + }); + else $state.go('onboarding.notifications', { + walletId: walletId + }); }); }); }; + $scope.confirm = function(emailForm) { + if (emailForm.$invalid) return; + $scope.confirmation = true; + $scope.email = emailForm.email.$modelValue; + }; + + $scope.cancel = function() { + $scope.confirmation = false; + $timeout(function() { + $scope.$digest(); + }, 1); + }; + $scope.onboardingMailSkip = function() { - $state.go('onboarding.backupRequest', {walletId: walletId}); + $state.go('onboarding.backupRequest', { + walletId: walletId + }); }; }); diff --git a/src/js/services/popupService.js b/src/js/services/popupService.js index c94e6df6a..a510ca153 100644 --- a/src/js/services/popupService.js +++ b/src/js/services/popupService.js @@ -10,14 +10,19 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni if (!cb) cb = function() {}; $ionicPopup.alert({ title: title, - template: message + template: message, + okType: 'button-clear button-positive' }).then(cb); }; - var _ionicConfirm = function(title, message, cb) { + var _ionicConfirm = function(title, message, okText, cancelText, cb) { $ionicPopup.confirm({ title: title, - template: message + template: message, + cancelText: cancelText, + cancelType: 'button-clear button-positive', + okText: okText, + okType: 'button-clear button-positive' }).then(function(res) { return cb(res); }); @@ -42,16 +47,16 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni navigator.notification.alert(message, cb, title); }; - var _cordovaConfirm = function(title, message, cb) { - var onConfirm = function (buttonIndex) { + var _cordovaConfirm = function(title, message, okText, cancelText, cb) { + var onConfirm = function(buttonIndex) { if (buttonIndex == 1) return cb(true); else return cb(false); } - navigator.notification.confirm(message, onConfirm, title); + navigator.notification.confirm(message, onConfirm, title, [okText, cancelText]); }; var _cordovaPrompt = function(title, message, cb) { - var onPrompt = function (results) { + var onPrompt = function(results) { if (results.buttonIndex == 1) return cb(results.input1); else return cb(); } @@ -81,17 +86,19 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni * * @param {String} Title * @param {String} Message + * @param {String} okText + * @param {String} cancelText * @param {Callback} Function * @returns {Callback} OK: true, Cancel: false */ - this.showConfirm = function(title, message, cb) { + this.showConfirm = function(title, message, okText, cancelText, cb) { $log.warn(title + ": " + message); if (isCordova) - _cordovaConfirm(title, message, cb); + _cordovaConfirm(title, message, okText, cancelText, cb); else - _ionicConfirm(title, message, cb); + _ionicConfirm(title, message, okText, cancelText, cb); }; /** diff --git a/src/sass/views/onboarding/onboard-collect-email.scss b/src/sass/views/onboarding/onboard-collect-email.scss index 3cc60ce01..ad0be19fb 100644 --- a/src/sass/views/onboarding/onboard-collect-email.scss +++ b/src/sass/views/onboarding/onboard-collect-email.scss @@ -14,25 +14,22 @@ margin-top: 1rem; margin-bottom: 1rem; } - .collect-overlay, .bar-overlay { - animation-name: opacity; - animation-iteration-count: 1; - animation-timing-function: ease-in; - animation-duration: .2s; - animation-delay: .8s; - animation-fill-mode: forwards; - opacity: 0; - } - .collect-overlay{ - top:-1px; - } - .bar-overlay{ - background: rgba(0, 0, 0, 0.23); - .button-clear{ - color:#fff; - min-width: 100%; - } - } + .collect-overlay { + animation-name: opacity; + animation-iteration-count: 1; + animation-timing-function: ease-in; + animation-duration: .2s; + animation-delay: .8s; + animation-fill-mode: forwards; + opacity: 0; + button { + position: absolute; + right: 11px; + } + } + .collect-overlay{ + top:-1px; + } #collect-email { opacity: 1; background: #fff; @@ -52,10 +49,7 @@ label { background: rgba(200, 200, 200, 0.20); height: 3rem; - margin-top: 0; - input { - position: absolute; - } + margin-top:0; i { position: absolute; right: 3%; From 8eac86d32a7a32849405ab0ebd5733f7e26b787d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 12 Sep 2016 13:58:36 -0300 Subject: [PATCH 15/23] fix showconfirm calls --- src/js/controllers/copayers.js | 2 +- src/js/controllers/preferencesBitpayCard.js | 2 +- src/js/controllers/preferencesDelete.js | 2 +- src/js/controllers/preferencesGlidera.js | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/copayers.js b/src/js/controllers/copayers.js index b95a22121..2743f800f 100644 --- a/src/js/controllers/copayers.js +++ b/src/js/controllers/copayers.js @@ -21,7 +21,7 @@ angular.module('copayApp.controllers').controller('copayersController', $scope.isCordova = platformInfo.isCordova; $scope.showDeletePopup = function() { - popupService.showConfirm(gettextCatalog.getString('Confirm'), gettextCatalog.getString('Are you sure you want to delete this wallet?'), function(res) { + popupService.showConfirm(gettextCatalog.getString('Confirm'), gettextCatalog.getString('Are you sure you want to delete this wallet?'), null, null, function(res) { if (res) deleteWallet(); }); }; diff --git a/src/js/controllers/preferencesBitpayCard.js b/src/js/controllers/preferencesBitpayCard.js index 8a297c8aa..9e4c9da8a 100644 --- a/src/js/controllers/preferencesBitpayCard.js +++ b/src/js/controllers/preferencesBitpayCard.js @@ -5,7 +5,7 @@ angular.module('copayApp.controllers').controller('preferencesBitpayCardControll $scope.logout = function() { var title = 'Are you sure you would like to log out of your Bitpay Card account?'; - popupService.showConfirm(title, null, function(res) { + popupService.showConfirm(title, null, null, null, function(res) { if (res) logout(); }); }; diff --git a/src/js/controllers/preferencesDelete.js b/src/js/controllers/preferencesDelete.js index 8e95a31c1..1ec93fd4b 100644 --- a/src/js/controllers/preferencesDelete.js +++ b/src/js/controllers/preferencesDelete.js @@ -10,7 +10,7 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro $scope.showDeletePopup = function() { var title = gettextCatalog.getString('Warning!'); var message = gettextCatalog.getString('Are you sure you want to delete this wallet?'); - popupService.showConfirm(title, message, function(res) { + popupService.showConfirm(title, message, null, null, function(res) { if (res) deleteWallet(); }); }; diff --git a/src/js/controllers/preferencesGlidera.js b/src/js/controllers/preferencesGlidera.js index 86c3516af..16749e66e 100644 --- a/src/js/controllers/preferencesGlidera.js +++ b/src/js/controllers/preferencesGlidera.js @@ -23,7 +23,9 @@ angular.module('copayApp.controllers').controller('preferencesGlideraController' } $scope.token = glidera.token; $scope.permissions = glidera.permissions; - $scope.update({fullUpdate: true}); + $scope.update({ + fullUpdate: true + }); }); }; @@ -62,7 +64,7 @@ angular.module('copayApp.controllers').controller('preferencesGlideraController' }; $scope.revokeToken = function() { - popupService.showConfirm('Glidera', 'Are you sure you would like to log out of your Glidera account?', function(res) { + popupService.showConfirm('Glidera', 'Are you sure you would like to log out of your Glidera account?', null, null, function(res) { if (res) { glideraService.removeToken(function() { $timeout(function() { From 3c353fdbcb0bb07a58ba0eb4d61afe5780d80425 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 12 Sep 2016 15:04:12 -0300 Subject: [PATCH 16/23] show receive tips --- public/views/modals/receive-tips.html | 15 +++++++++++++++ public/views/modals/scan-tips.html | 15 +++++++++++++++ src/js/controllers/modals/receiveTips.js | 11 +++++++++++ src/js/controllers/tab-receive.js | 15 ++++++++++++++- src/js/services/storageService.js | 8 ++++++++ 5 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 public/views/modals/receive-tips.html create mode 100644 public/views/modals/scan-tips.html create mode 100644 src/js/controllers/modals/receiveTips.js diff --git a/public/views/modals/receive-tips.html b/public/views/modals/receive-tips.html new file mode 100644 index 000000000..b148acd35 --- /dev/null +++ b/public/views/modals/receive-tips.html @@ -0,0 +1,15 @@ + + + + + + + +
+

Receive bitcoin by sharing your address

+

Other bitcoin users can scan this code to send you money

+
+
+
diff --git a/public/views/modals/scan-tips.html b/public/views/modals/scan-tips.html new file mode 100644 index 000000000..07ef9e5c7 --- /dev/null +++ b/public/views/modals/scan-tips.html @@ -0,0 +1,15 @@ + + + + + + + +
+

Receive bitcoin by sharing your address

+

Other bitcoin users can scan this code to send you money

+
+
+
diff --git a/src/js/controllers/modals/receiveTips.js b/src/js/controllers/modals/receiveTips.js new file mode 100644 index 000000000..5412a614b --- /dev/null +++ b/src/js/controllers/modals/receiveTips.js @@ -0,0 +1,11 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('receiveTipsController', function($scope, $log, storageService) { + $scope.close = function() { + $log.debug('Receive tips accepted'); + storageService.setReceiveTipsAccepted(true, function(err) { + $scope.receiveTipsModal.hide(); + $scope.receiveTipsModal.remove(); + }); + } +}); diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 3a03d090a..25ceb5964 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabReceiveController', function($scope, $timeout, $log, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService) { +angular.module('copayApp.controllers').controller('tabReceiveController', function($scope, $timeout, $log, $ionicModal, storageService, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService) { $scope.isCordova = platformInfo.isCordova; @@ -10,6 +10,19 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi }); $scope.isCordova = platformInfo.isCordova; $scope.isNW = platformInfo.isNW; + + storageService.getReceiveTipsAccepted(function(err, accepted) { + if (err || accepted) return; + + $timeout(function() { + $ionicModal.fromTemplateUrl('views/modals/receive-tips.html', { + scope: $scope + }).then(function(modal) { + $scope.receiveTipsModal = modal; + $scope.receiveTipsModal.show(); + }); + }, 1000); + }); } $scope.$on('Wallet/Changed', function(event, wallet) { diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index a498dfb89..b41b63834 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -342,6 +342,14 @@ angular.module('copayApp.services') }); }; + root.setReceiveTipsAccepted = function(val, cb) { + storage.set('receiveTips', val, cb); + }; + + root.getReceiveTipsAccepted = function(cb) { + storage.get('receiveTips', cb); + }; + root.setAmazonGiftCards = function(network, gcs, cb) { storage.set('amazonGiftCards-' + network, gcs, cb); }; From d834d5610422d9b36bf8a5270b70d795b1604e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 12 Sep 2016 16:24:02 -0300 Subject: [PATCH 17/23] hide tabs when native keyboard is open --- src/js/routes.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/js/routes.js b/src/js/routes.js index e37d8efa2..236bc0457 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -739,6 +739,16 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr cordova.plugins.Keyboard.disableScroll(true); } + window.addEventListener('native.keyboardshow', function() { + document.querySelector('div.tabs').style.display = 'none'; + angular.element(document.querySelector('ion-content.has-tabs')).css('bottom', 0); + }); + + window.addEventListener('native.keyboardhide', function() { + var tabs = document.querySelectorAll('div.tabs'); + angular.element(tabs[0]).css('display', ''); + }); + $ionicPlatform.registerBackButtonAction(function(e) { var fromDisclaimer = $ionicHistory.currentStateName().match(/disclaimer/) ? 'true' : ''; From 091ae73e2d33c4f1253d35c6375e94ce158fb721 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 12 Sep 2016 16:41:04 -0300 Subject: [PATCH 18/23] show scan tips --- public/views/modals/scan-tips.html | 8 ++++---- src/js/controllers/modals/receiveTips.js | 1 - src/js/controllers/modals/scanTips.js | 11 +++++++++++ src/js/controllers/modals/scanner.js | 25 +++++++++++++++++++++++- src/js/controllers/tab-receive.js | 8 ++++++-- src/js/services/storageService.js | 8 ++++++++ 6 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 src/js/controllers/modals/scanTips.js diff --git a/public/views/modals/scan-tips.html b/public/views/modals/scan-tips.html index 07ef9e5c7..512b60327 100644 --- a/public/views/modals/scan-tips.html +++ b/public/views/modals/scan-tips.html @@ -1,15 +1,15 @@ - + -
-

Receive bitcoin by sharing your address

-

Other bitcoin users can scan this code to send you money

+

Scan the code to pay with bitcoin

+

QR codes could also contain a bitcoin wallet invitation, or an URL

diff --git a/src/js/controllers/modals/receiveTips.js b/src/js/controllers/modals/receiveTips.js index 5412a614b..2297be7a4 100644 --- a/src/js/controllers/modals/receiveTips.js +++ b/src/js/controllers/modals/receiveTips.js @@ -5,7 +5,6 @@ angular.module('copayApp.controllers').controller('receiveTipsController', funct $log.debug('Receive tips accepted'); storageService.setReceiveTipsAccepted(true, function(err) { $scope.receiveTipsModal.hide(); - $scope.receiveTipsModal.remove(); }); } }); diff --git a/src/js/controllers/modals/scanTips.js b/src/js/controllers/modals/scanTips.js new file mode 100644 index 000000000..a82f70554 --- /dev/null +++ b/src/js/controllers/modals/scanTips.js @@ -0,0 +1,11 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('scanTipsController', function($scope, $log, storageService) { + $scope.close = function() { + $log.debug('Scan tips accepted'); + storageService.setScanTipsAccepted(true, function(err) { + $scope.$emit('TipsModalClosed', function() {}); + $scope.scanTipsModal.hide(); + }); + } +}); diff --git a/src/js/controllers/modals/scanner.js b/src/js/controllers/modals/scanner.js index c1bccb708..f92b2d14f 100644 --- a/src/js/controllers/modals/scanner.js +++ b/src/js/controllers/modals/scanner.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('scannerController', function($scope, $timeout) { +angular.module('copayApp.controllers').controller('scannerController', function($scope, $timeout, storageService, $ionicModal) { // QR code Scanner var video; @@ -73,6 +73,29 @@ angular.module('copayApp.controllers').controller('scannerController', function( }; $scope.init = function() { + storageService.getScanTipsAccepted(function(err, accepted) { + if (err) $log.warn(err); + if (accepted) { + scannerInit(); + return; + } + + $timeout(function() { + $ionicModal.fromTemplateUrl('views/modals/scan-tips.html', { + scope: $scope + }).then(function(modal) { + $scope.scanTipsModal = modal; + $scope.scanTipsModal.show(); + }); + }, 1000); + }); + }; + + $scope.$on('TipsModalClosed', function(event) { + scannerInit(); + }); + + function scannerInit() { setScanner(); $timeout(function() { if ($scope.beforeScan) { diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 25ceb5964..2fa2147f6 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -10,9 +10,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi }); $scope.isCordova = platformInfo.isCordova; $scope.isNW = platformInfo.isNW; + $scope.checkTips(); + } + $scope.checkTips = function() { storageService.getReceiveTipsAccepted(function(err, accepted) { - if (err || accepted) return; + if (err) $log.warn(err); + if (accepted) return; $timeout(function() { $ionicModal.fromTemplateUrl('views/modals/receive-tips.html', { @@ -23,7 +27,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi }); }, 1000); }); - } + }; $scope.$on('Wallet/Changed', function(event, wallet) { if (!wallet) { diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index b41b63834..5e23c7114 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -342,6 +342,14 @@ angular.module('copayApp.services') }); }; + root.setScanTipsAccepted = function(val, cb) { + storage.set('scanTips', val, cb); + }; + + root.getScanTipsAccepted = function(cb) { + storage.get('scanTips', cb); + }; + root.setReceiveTipsAccepted = function(val, cb) { storage.set('receiveTips', val, cb); }; From 50434d7ab6faf3b6b53a255b045d1df60fb572e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 12 Sep 2016 16:50:31 -0300 Subject: [PATCH 19/23] code refactor --- {public/views => old}/preferencesGlobal.html | 0 {public/views/includes => old}/topbar.html | 0 public/views/preferencesHistory.html | 6 +++--- src/js/controllers/preferencesHistory.js | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) rename {public/views => old}/preferencesGlobal.html (100%) rename {public/views/includes => old}/topbar.html (100%) diff --git a/public/views/preferencesGlobal.html b/old/preferencesGlobal.html similarity index 100% rename from public/views/preferencesGlobal.html rename to old/preferencesGlobal.html diff --git a/public/views/includes/topbar.html b/old/topbar.html similarity index 100% rename from public/views/includes/topbar.html rename to old/topbar.html diff --git a/public/views/preferencesHistory.html b/public/views/preferencesHistory.html index e2d2d8d55..1118a2a99 100644 --- a/public/views/preferencesHistory.html +++ b/public/views/preferencesHistory.html @@ -4,12 +4,12 @@ - +
-
+
Export to file
-
+
Export to file preparing... diff --git a/src/js/controllers/preferencesHistory.js b/src/js/controllers/preferencesHistory.js index a44f69b36..500a8bd53 100644 --- a/src/js/controllers/preferencesHistory.js +++ b/src/js/controllers/preferencesHistory.js @@ -1,10 +1,11 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesHistory', - function($scope, $log, $stateParams, $timeout, $ionicNavBarDelegate, gettextCatalog, storageService, $state, $ionicHistory, profileService, lodash) { + function($scope, $log, $stateParams, $timeout, $state, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, storageService, platformInfo, profileService, lodash) { $ionicNavBarDelegate.title(gettextCatalog.getString('Transaction History')); $scope.wallet = profileService.getWallet($stateParams.walletId); $scope.csvReady = false; + $scope.isCordova = platformInfo.isCordova; $scope.csvHistory = function(cb) { var allTxs = []; From 62433d8fb98a72ab2d299070733de78954a7354e Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 12 Sep 2016 17:54:09 -0300 Subject: [PATCH 20/23] Fix link to add --- public/views/addressbook.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/views/addressbook.html b/public/views/addressbook.html index 3c4374150..3262e0c19 100644 --- a/public/views/addressbook.html +++ b/public/views/addressbook.html @@ -42,7 +42,7 @@
- + Add a new entry From 11865c25efec66a076f8bf995fee5eba5dd7c88e Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 12 Sep 2016 17:59:36 -0300 Subject: [PATCH 21/23] not available for mobile --- src/js/controllers/modals/scanner.js | 8 +++++++- src/js/controllers/tab-receive.js | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/modals/scanner.js b/src/js/controllers/modals/scanner.js index f92b2d14f..6616d505a 100644 --- a/src/js/controllers/modals/scanner.js +++ b/src/js/controllers/modals/scanner.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('scannerController', function($scope, $timeout, storageService, $ionicModal) { +angular.module('copayApp.controllers').controller('scannerController', function($scope, $timeout, storageService, $ionicModal, platformInfo) { // QR code Scanner var video; @@ -73,6 +73,12 @@ angular.module('copayApp.controllers').controller('scannerController', function( }; $scope.init = function() { + if (platformInfo.isCordova) scannerInit(); + else checkTips(); + }; + + function checkTips() { + //TODO addapt tips to the new QR plugin (mobile) storageService.getScanTipsAccepted(function(err, accepted) { if (err) $log.warn(err); if (accepted) { diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 2fa2147f6..187d3822e 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -8,9 +8,9 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi $scope.wallets = profileService.getWallets({ onlyComplete: true }); - $scope.isCordova = platformInfo.isCordova; $scope.isNW = platformInfo.isNW; - $scope.checkTips(); + $scope.isCordova = platformInfo.isCordova; + if (!$scope.isCordova) $scope.checkTips(); } $scope.checkTips = function() { From 9a7e274485e7dae0ec34b8e44c17e1195801e371 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 12 Sep 2016 18:04:56 -0300 Subject: [PATCH 22/23] Fix tab-send --- public/views/tab-send.html | 2 +- src/js/controllers/tab-send.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/views/tab-send.html b/public/views/tab-send.html index ace36d6fd..4da7003e1 100644 --- a/public/views/tab-send.html +++ b/public/views/tab-send.html @@ -25,7 +25,7 @@ - {{item.label}} + {{item.name}}
diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 92d691f8d..a9756e008 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -14,7 +14,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( lodash.each(wallets, function(v) { originalList.push({ color: v.color, - label: v.name, + name: v.name, isWallet: true, getAddress: function(cb) { walletService.getAddress(v, false, cb); @@ -28,7 +28,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( var contacts = []; lodash.each(ab, function(v, k) { contacts.push({ - label: v, + name: lodash.isObject(v) ? v.name : v, address: k, getAddress: function(cb) { return cb(null, k); @@ -60,7 +60,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } var result = lodash.filter(originalList, function(item) { - var val = item.label || item.alias || item.name; + var val = item.name; return lodash.includes(val.toLowerCase(), search.toLowerCase()); }); @@ -73,10 +73,10 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $log.error(err); return; } - $log.debug('Got toAddress:' + addr + ' | ' + item.label); + $log.debug('Got toAddress:' + addr + ' | ' + item.name); return $state.transitionTo('send.amount', { toAddress: addr, - toName: item.label + toName: item.name }) }); }; From ff0e407e1919783307d0e52514af43baf9bb6c61 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 13 Sep 2016 09:58:54 -0300 Subject: [PATCH 23/23] Updates bwc --- app-template/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app-template/package.json b/app-template/package.json index 64474379a..4cb6f7c94 100644 --- a/app-template/package.json +++ b/app-template/package.json @@ -42,7 +42,7 @@ "url": "https://github.com/bitpay/copay/issues" }, "dependencies": { - "bitcore-wallet-client": "4.2.0", + "bitcore-wallet-client": "4.2.1", "coveralls": "^2.11.9", "express": "^4.11.2", "fs": "0.0.2", diff --git a/package.json b/package.json index f353072c2..94e489f66 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "url": "https://github.com/bitpay/copay/issues" }, "dependencies": { - "bitcore-wallet-client": "4.2.0", + "bitcore-wallet-client": "4.2.1", "coveralls": "^2.11.9", "express": "^4.11.2", "fs": "0.0.2",