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 1/4] 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 2/4] 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 3/4] 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 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 4/4] 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