From 32a9c208b7b4ef66210e7bff6d650370e2528878 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 13 Sep 2016 11:12:18 -0300 Subject: [PATCH 01/12] Fix addressbook directive --- src/js/directives/directives.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js index d9bee9bf3..ecf849b10 100644 --- a/src/js/directives/directives.js +++ b/src/js/directives/directives.js @@ -113,15 +113,16 @@ angular.module('copayApp.directives') } } }) - .directive('contact', ['addressbookService', - function(addressbookService) { + .directive('contact', ['addressbookService', 'lodash', + function(addressbookService, lodash) { return { restrict: 'E', link: function(scope, element, attrs) { var addr = attrs.address; - addressbookService.getLabel(addr, function(label) { - if (label) { - element.append(label); + addressbookService.get(addr, function(err, ab) { + if (ab) { + var name = lodash.isObject(ab) ? ab.name : ab; + element.append(name); } else { element.append(addr); } From 3d927267bc3da6d27f87e37977dabb4d3cbb094a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 13 Sep 2016 17:12:17 -0300 Subject: [PATCH 02/12] onboarding - disable scroll - skip notification view on android --- public/views/onboarding/backupRequest.html | 2 +- public/views/onboarding/backupWarning.html | 2 +- public/views/onboarding/collectEmail.html | 2 +- public/views/onboarding/disclaimer.html | 2 +- public/views/onboarding/notifications.html | 2 +- public/views/onboarding/tour.html | 6 ++-- public/views/onboarding/welcome.html | 2 +- .../controllers/onboarding/backupWarning.js | 7 +++-- src/js/controllers/onboarding/collectEmail.js | 31 ++++++++++++------- .../controllers/onboarding/notifications.js | 4 ++- src/js/routes.js | 14 ++++----- src/js/services/profileService.js | 3 -- 12 files changed, 44 insertions(+), 33 deletions(-) diff --git a/public/views/onboarding/backupRequest.html b/public/views/onboarding/backupRequest.html index 0284f8bdf..df33a168e 100644 --- a/public/views/onboarding/backupRequest.html +++ b/public/views/onboarding/backupRequest.html @@ -1,5 +1,5 @@ - +
diff --git a/public/views/onboarding/backupWarning.html b/public/views/onboarding/backupWarning.html index 19f21d0ac..cc3de6fc5 100644 --- a/public/views/onboarding/backupWarning.html +++ b/public/views/onboarding/backupWarning.html @@ -6,7 +6,7 @@ - +

Are you being watched? diff --git a/public/views/onboarding/collectEmail.html b/public/views/onboarding/collectEmail.html index a63f2c652..d5d9babda 100644 --- a/public/views/onboarding/collectEmail.html +++ b/public/views/onboarding/collectEmail.html @@ -40,7 +40,7 @@

-
diff --git a/public/views/onboarding/disclaimer.html b/public/views/onboarding/disclaimer.html index 9f48d769c..4d9887bc9 100644 --- a/public/views/onboarding/disclaimer.html +++ b/public/views/onboarding/disclaimer.html @@ -1,5 +1,5 @@ - +

Almost done! Let's review

diff --git a/public/views/onboarding/notifications.html b/public/views/onboarding/notifications.html index d086b1355..487e7b555 100644 --- a/public/views/onboarding/notifications.html +++ b/public/views/onboarding/notifications.html @@ -1,5 +1,5 @@ - +

Push Notifications diff --git a/public/views/onboarding/tour.html b/public/views/onboarding/tour.html index d4be4de4a..53ed9de5d 100644 --- a/public/views/onboarding/tour.html +++ b/public/views/onboarding/tour.html @@ -14,7 +14,7 @@ - +

Bitcoin is secure, digital money

@@ -38,7 +38,7 @@
- +

Bitcoin is a currency

@@ -62,7 +62,7 @@
- +

You control your bitcoin

diff --git a/public/views/onboarding/welcome.html b/public/views/onboarding/welcome.html index c34097a19..492247590 100644 --- a/public/views/onboarding/welcome.html +++ b/public/views/onboarding/welcome.html @@ -1,5 +1,5 @@ - +
diff --git a/src/js/controllers/onboarding/backupWarning.js b/src/js/controllers/onboarding/backupWarning.js index b7099ed8a..4538124a2 100644 --- a/src/js/controllers/onboarding/backupWarning.js +++ b/src/js/controllers/onboarding/backupWarning.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $stateParams, $ionicPopup, profileService) { +angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $timeout, $stateParams, $ionicPopup, profileService) { $scope.walletId = $stateParams.walletId; $scope.openPopup = function() { @@ -11,7 +11,10 @@ angular.module('copayApp.controllers').controller('backupWarningController', fun $scope.close = function() { backupWarningPopup.close(); - $state.go('onboarding.backup', {walletId: $stateParams.walletId, fromOnboarding: true}); + $state.go('onboarding.backup', { + walletId: $stateParams.walletId, + fromOnboarding: true + }); }; } }); diff --git a/src/js/controllers/onboarding/collectEmail.js b/src/js/controllers/onboarding/collectEmail.js index 6479e0ea8..acf7dfd6f 100644 --- a/src/js/controllers/onboarding/collectEmail.js +++ b/src/js/controllers/onboarding/collectEmail.js @@ -5,6 +5,7 @@ angular.module('copayApp.controllers').controller('collectEmailController', func var isCordova = platformInfo.isCordova; var isWP = platformInfo.isWP; var usePushNotifications = isCordova && !isWP; + var requiresOptIn = platformInfo.isIOS; var wallet = profileService.getWallet($stateParams.walletId); var walletId = wallet.credentials.walletId; @@ -21,16 +22,29 @@ 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 - }); + goNextView(); }); }); }; + var goNextView = function() { + if (!usePushNotifications) { + $state.go('onboarding.backupRequest', { + walletId: walletId + }); + } + else if (requiresOptIn) { + $state.go('onboarding.notifications', { + walletId: walletId + }); + } else { + profileService.pushNotificationsInit(); + $state.go('onboarding.backupRequest', { + walletId: walletId + }); + } + }; + $scope.confirm = function(emailForm) { if (emailForm.$invalid) return; $scope.confirmation = true; @@ -44,9 +58,4 @@ angular.module('copayApp.controllers').controller('collectEmailController', func }, 1); }; - $scope.onboardingMailSkip = function() { - $state.go('onboarding.backupRequest', { - walletId: walletId - }); - }; }); diff --git a/src/js/controllers/onboarding/notifications.js b/src/js/controllers/onboarding/notifications.js index 7f22581fd..a2444abf0 100644 --- a/src/js/controllers/onboarding/notifications.js +++ b/src/js/controllers/onboarding/notifications.js @@ -5,7 +5,9 @@ angular.module('copayApp.controllers').controller('notificationsController', fun $scope.walletId = $stateParams.walletId; $scope.allowNotif = function() { profileService.pushNotificationsInit(); - $state.go('onboarding.backupRequest'); + $state.go('onboarding.backupRequest', { + walletId: $scope.walletId + }); } }); diff --git a/src/js/routes.js b/src/js/routes.js index 0c2158085..3466bab77 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -490,14 +490,14 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) - /* - * - * Addressbook - * - */ + /* + * + * Addressbook + * + */ - .state('tabs.addressbook', { + .state('tabs.addressbook', { url: '/addressbook', views: { 'tab-settings': { @@ -761,7 +761,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }); }) - .run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService) { + .run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, $ionicScrollDelegate, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService) { uxLanguage.init(); openURLService.init(); diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index e13af5c93..c549afb88 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -268,9 +268,6 @@ angular.module('copayApp.services') if (!val) { return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer')); } - if (usePushNotifications) - root.pushNotificationsInit(); - $rootScope.$emit('disclaimerAccepted'); return cb(); }); }); From a8567eabb4a64c9adf1d7edbe1295ad374e71d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 13 Sep 2016 17:13:53 -0300 Subject: [PATCH 03/12] fixes --- src/js/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/routes.js b/src/js/routes.js index 3466bab77..36b618b25 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -761,7 +761,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }); }) - .run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, $ionicScrollDelegate, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService) { + .run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService) { uxLanguage.init(); openURLService.init(); From 431058baec823de85c9ab4799e267600d5883a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 13 Sep 2016 17:31:29 -0300 Subject: [PATCH 04/12] fix save last state --- src/js/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/routes.js b/src/js/routes.js index 36b618b25..77955cf2a 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -877,6 +877,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr var state = {}; state.name = toState.name; state.toParams = toParams; - storageService.setLastState(JSON.stringify(state), function() {}); + if (state.name != 'starting') storageService.setLastState(JSON.stringify(state), function() {}); }); }); From d6601637f9f71f01df3e4c51ae4f408e88e38f3d Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 13 Sep 2016 17:39:01 -0300 Subject: [PATCH 05/12] Adds gravatar --- Gruntfile.js | 1 + bower.json | 3 ++- public/views/addressbook.html | 7 ++++--- public/views/addressbook.view.html | 4 ++++ src/js/app.js | 1 + src/js/directives/gravatar.js | 20 ++++++++++++++++++++ src/sass/main.scss | 21 +++++++++++++++++++++ 7 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 src/js/directives/gravatar.js diff --git a/Gruntfile.js b/Gruntfile.js index 05df4524b..5b610e424 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -120,6 +120,7 @@ module.exports = function(grunt) { 'bower_components/ng-csv/build/ng-csv.js', 'bower_components/ionic-toast/dist/ionic-toast.bundle.min.js', 'bower_components/angular-clipboard/angular-clipboard.js', + 'bower_components/angular-md5/angular-md5.js', 'bower_components/angular-mocks/angular-mocks.js', 'angular-pbkdf2/angular-pbkdf2.js', 'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js' diff --git a/bower.json b/bower.json index e7daba801..ed6b9bd64 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,8 @@ "trezor-connect": "~1.0.1", "ng-csv": "~0.3.6", "ionic-toast": "^0.4.1", - "angular-clipboard": "^1.4.2" + "angular-clipboard": "^1.4.2", + "angular-md5": "^0.1.10" }, "resolutions": { "angular": "1.5.3" diff --git a/public/views/addressbook.html b/public/views/addressbook.html index 3262e0c19..fdd60accb 100644 --- a/public/views/addressbook.html +++ b/public/views/addressbook.html @@ -29,10 +29,11 @@ - - {{addrEntry.name}} + +

{{addrEntry.name}}

+

{{addrEntry.address}}

diff --git a/public/views/addressbook.view.html b/public/views/addressbook.view.html index 00b191e7f..16549a4ec 100644 --- a/public/views/addressbook.view.html +++ b/public/views/addressbook.view.html @@ -12,6 +12,10 @@ +
+ +
+

Name

diff --git a/src/js/app.js b/src/js/app.js index d4cd8448c..001bf9826 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -9,6 +9,7 @@ var modules = [ 'angular-clipboard', 'ngLodash', 'ngCsv', + 'angular-md5', 'bwcModule', 'pbkdf2Module', 'copayApp.filters', diff --git a/src/js/directives/gravatar.js b/src/js/directives/gravatar.js new file mode 100644 index 000000000..2d28168d4 --- /dev/null +++ b/src/js/directives/gravatar.js @@ -0,0 +1,20 @@ +'use strict'; + +angular.module('copayApp.directives') + .directive('gravatar', function(md5) { + return { + restrict: 'AE', + replace: true, + scope: { + name: '@', + height: '@', + width: '@', + email: '@' + }, + link: function(scope, el, attr) { + scope.emailHash = md5.createHash(scope.email || ''); + }, + template: '{{ name }}' + } + }); + diff --git a/src/sass/main.scss b/src/sass/main.scss index 40aea0ae0..5985b0917 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -937,6 +937,27 @@ input[type=number] { } } +/** Gravatar **/ + +.gravatar { + border-radius: 50%; +} + +.gravatar-content { + position: relative; + height: 70px; + border-color: #172565; + background-color: #1e3186; + background-image: linear-gradient(0deg, #172565, #172565 0%, transparent 0%); + color: #fff; + margin-bottom: 50px; + .gravatar { + position: absolute; + bottom: -30px; + left: 41%; + } +} + /* Spinner */ .item-icon-left ion-spinner { From 8080e0b85652572fe1f609cce74395930fbd7395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 13 Sep 2016 23:25:50 -0300 Subject: [PATCH 06/12] fix skip button on email view --- src/js/controllers/onboarding/collectEmail.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/onboarding/collectEmail.js b/src/js/controllers/onboarding/collectEmail.js index acf7dfd6f..e00aaa098 100644 --- a/src/js/controllers/onboarding/collectEmail.js +++ b/src/js/controllers/onboarding/collectEmail.js @@ -22,12 +22,12 @@ angular.module('copayApp.controllers').controller('collectEmailController', func if (err) $log.warn(err); configService.set(opts, function(err) { if (err) $log.warn(err); - goNextView(); + $scope.goNextView(); }); }); }; - var goNextView = function() { + $scope.goNextView = function() { if (!usePushNotifications) { $state.go('onboarding.backupRequest', { walletId: walletId From c21d447031c00b4876ec67298a14585f907b2199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 14 Sep 2016 10:04:16 -0300 Subject: [PATCH 07/12] avatar in send view --- public/views/amount.html | 2 +- public/views/confirm.html | 4 ++-- public/views/tab-send.html | 2 +- src/js/controllers/amount.js | 2 ++ src/js/controllers/confirm.js | 1 + src/js/controllers/tab-send.js | 6 ++++-- src/js/routes.js | 4 ++-- src/sass/views/amount.scss | 6 +++++- src/sass/views/confirm.scss | 9 +++++++++ src/sass/views/tab-send.scss | 5 +++++ 10 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 src/sass/views/confirm.scss diff --git a/public/views/amount.html b/public/views/amount.html index cc39806df..e06f6ae9a 100644 --- a/public/views/amount.html +++ b/public/views/amount.html @@ -13,7 +13,7 @@
Recipient
- + {{toName || toAddress}}
diff --git a/public/views/confirm.html b/public/views/confirm.html index a36da1bc9..c763a8dfd 100644 --- a/public/views/confirm.html +++ b/public/views/confirm.html @@ -1,4 +1,4 @@ - + @@ -23,7 +23,7 @@
- + {{toAddress}}

{{toName}}

diff --git a/public/views/tab-send.html b/public/views/tab-send.html index 4da7003e1..c7d278453 100644 --- a/public/views/tab-send.html +++ b/public/views/tab-send.html @@ -24,7 +24,7 @@
No Wallet - Contact
- + {{item.name}}
diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 285771d19..c68f6bfab 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -50,6 +50,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.toAddress = $stateParams.toAddress; $scope.toName = $stateParams.toName; + $scope.toEmail = $stateParams.toEmail; var config = configService.getSync().wallet.settings; $scope.unitName = config.unitName; @@ -191,6 +192,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ toAmount: amount * unitToSatoshi, toAddress: $scope.toAddress, toName: $scope.toName, + toEmail: $scope.toEmail }); }; }); diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 58ca12906..b8929324f 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -102,6 +102,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( $scope.toAddress = $stateParams.toAddress; $scope.toName = $stateParams.toName; + $scope.toEmail = $stateParams.toEmail; $scope.description = $stateParams.description; $scope.paypro = $stateParams.paypro; diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index a9756e008..d483f92c6 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, $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; @@ -30,6 +30,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( contacts.push({ name: lodash.isObject(v) ? v.name : v, address: k, + email: lodash.isObject(v) ? v.email : null, getAddress: function(cb) { return cb(null, k); }, @@ -76,7 +77,8 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $log.debug('Got toAddress:' + addr + ' | ' + item.name); return $state.transitionTo('send.amount', { toAddress: addr, - toName: item.name + toName: item.name, + toEmail: item.email }) }); }; diff --git a/src/js/routes.js b/src/js/routes.js index 0c2158085..b73cfc5fe 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -235,7 +235,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr template: '' }) .state('send.amount', { - url: '/amount/:toAddress/:toName', + url: '/amount/:toAddress/:toName/:toEmail', views: { 'send': { templateUrl: 'views/amount.html' @@ -243,7 +243,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('send.confirm', { - url: '/confirm/:toAddress/:toName/:toAmount/:description/:paypro', + url: '/confirm/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro', views: { 'send': { templateUrl: 'views/confirm.html' diff --git a/src/sass/views/amount.scss b/src/sass/views/amount.scss index d89984be6..e459a46dd 100644 --- a/src/sass/views/amount.scss +++ b/src/sass/views/amount.scss @@ -9,7 +9,11 @@ padding-left: 48px; } } - + .send-gravatar { + left: 11px; + position: absolute; + top: 10px; + } .amount-pane { position: absolute; top: 125px; diff --git a/src/sass/views/confirm.scss b/src/sass/views/confirm.scss new file mode 100644 index 000000000..250509796 --- /dev/null +++ b/src/sass/views/confirm.scss @@ -0,0 +1,9 @@ +#view-confirm { + + .send-gravatar { + left: 11px; + position: absolute; + top: 10px; + } + +} diff --git a/src/sass/views/tab-send.scss b/src/sass/views/tab-send.scss index 44d2a2b1b..bc8664ec0 100644 --- a/src/sass/views/tab-send.scss +++ b/src/sass/views/tab-send.scss @@ -11,4 +11,9 @@ padding-bottom: 1px; } } + .send-gravatar { + left: 11px; + position: absolute; + top: 10px; + } } From f007fb305ddf65dc8559960a374ff29b6a3fae73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 14 Sep 2016 10:25:45 -0300 Subject: [PATCH 08/12] import new scss --- src/sass/main.scss | 1 + src/sass/views/confirm.scss | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sass/main.scss b/src/sass/main.scss index 5985b0917..ca2086550 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -982,6 +982,7 @@ input[type=number] { @import 'mixins/mixins'; @import "views/add"; @import "views/amount"; +@import "views/confirm"; @import "views/tab-home"; @import "views/tab-receive"; @import "views/tab-send"; diff --git a/src/sass/views/confirm.scss b/src/sass/views/confirm.scss index 250509796..396588118 100644 --- a/src/sass/views/confirm.scss +++ b/src/sass/views/confirm.scss @@ -1,9 +1,7 @@ #view-confirm { - .send-gravatar { left: 11px; position: absolute; top: 10px; } - } From 2f8227ff278fd75ef250bb112c0d8bf32c2b8c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 14 Sep 2016 11:00:48 -0300 Subject: [PATCH 09/12] 1 of X wallets should not produce proposals --- src/js/services/profileService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index c549afb88..8e0f7c118 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -874,7 +874,7 @@ angular.module('copayApp.services') return !typeFilter1[x.type]; }); - if (wallet.n == 1) { + if (wallet.m == 1) { var n = lodash.filter(n, function(x) { return !typeFilter2[x.type]; }); From e69ceffb593b0d564b32f42524d401a242286f9d Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Wed, 14 Sep 2016 11:03:43 -0300 Subject: [PATCH 10/12] filter unavailable wallets --- src/js/controllers/confirm.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index b8929324f..486f35a79 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -120,12 +120,14 @@ angular.module('copayApp.controllers').controller('confirmController', function( lodash.each(wallets, function(w) { walletService.getStatus(w, {}, function(err, status) { - if (err) $log.error(err); - if (!status.availableBalanceSat) $log.debug('No balance available in: ' + w.name); - if (status.availableBalanceSat > amount) filteredWallets.push(w); + if (err || !status) { + $log.error(err); + } else { + if (!status.availableBalanceSat) $log.debug('No balance available in: ' + w.name); + if (status.availableBalanceSat > amount) filteredWallets.push(w); + } if (++index == wallets.length) { - if (!lodash.isEmpty(filteredWallets)) { $scope.wallets = lodash.clone(filteredWallets); $scope.notAvailable = false; @@ -136,7 +138,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( $timeout(function() { $scope.$apply(); - }, 10); + }); return; } }); From caeac6045cc826ad10a1b6c2e5406faf9db26c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 14 Sep 2016 11:08:47 -0300 Subject: [PATCH 11/12] fixes --- src/js/services/profileService.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 8e0f7c118..d3a81e915 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -870,12 +870,15 @@ angular.module('copayApp.services') if (err) { $log.warn('Error updating notifications:' + err); } else { - var n = lodash.filter(wallet.cachedActivity.n, function(x) { + + var n; + + n = lodash.filter(wallet.cachedActivity.n, function(x) { return !typeFilter1[x.type]; }); if (wallet.m == 1) { - var n = lodash.filter(n, function(x) { + n = lodash.filter(n, function(x) { return !typeFilter2[x.type]; }); } From d6e78b00f7a12b63662cea0c4df39f69629b0a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 14 Sep 2016 11:19:49 -0300 Subject: [PATCH 12/12] lock orientation when screen width < 768 --- src/js/routes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/routes.js b/src/js/routes.js index e0d11efac..c8c928e9d 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -769,6 +769,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr $ionicPlatform.ready(function() { if (platformInfo.isCordova) { + if (screen.width < 768) + screen.lockOrientation('portrait'); + if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true);