onboarding - disable scroll - skip notification view on android

This commit is contained in:
Gabriel Bazán 2016-09-13 17:12:17 -03:00
commit 3d927267bc
12 changed files with 44 additions and 33 deletions

View file

@ -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
});
};
}
});

View file

@ -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
});
};
});

View file

@ -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
});
}
});

View file

@ -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();

View file

@ -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();
});
});