onboarding allow push notifications
This commit is contained in:
parent
f1805b2080
commit
effbd098a6
8 changed files with 36 additions and 28 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<ion-view ng-controller="collectEmailController" ng-init="init()">
|
<ion-view ng-controller="collectEmailController">
|
||||||
<ion-nav-bar class="bar-stable">
|
<ion-nav-bar class="bar-stable">
|
||||||
<ion-nav-buttons side="secondary">
|
<ion-nav-buttons side="secondary">
|
||||||
<button class="button no-border" href ui-sref="onboarding.notifications">
|
<button class="button no-border" ng-click="skip()">
|
||||||
Skip
|
Skip
|
||||||
</button>
|
</button>
|
||||||
</ion-nav-buttons>
|
</ion-nav-buttons>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<ion-view>
|
<ion-view>
|
||||||
<ion-content ng-controller="notificationsController" >
|
<ion-content ng-controller="notificationsController">
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h1 translate>
|
<h1 translate>
|
||||||
Push Notifications
|
Push Notifications
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('backupRequestController', function($rootScope, $scope, $state, $ionicPopup, $stateParams, profileService, walletService) {
|
angular.module('copayApp.controllers').controller('backupRequestController', function($scope, $state, $ionicPopup) {
|
||||||
|
|
||||||
$scope.openPopup = function() {
|
$scope.openPopup = function() {
|
||||||
var backupLaterPopup = $ionicPopup.show({
|
var backupLaterPopup = $ionicPopup.show({
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('backupWarningController', function($rootScope, $scope, $state, $ionicPopup, $stateParams, profileService, walletService) {
|
angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $ionicPopup, profileService) {
|
||||||
|
|
||||||
$scope.openPopup = function() {
|
$scope.openPopup = function() {
|
||||||
var backupWarningPopup = $ionicPopup.show({
|
var backupWarningPopup = $ionicPopup.show({
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('collectEmailController', function($rootScope, $scope, $state, $stateParams, $timeout, $ionicModal, profileService, walletService) {
|
angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $stateParams, profileService, walletService, platformInfo) {
|
||||||
|
|
||||||
|
$scope.skip = function() {
|
||||||
|
if (!platformInfo.isCordova) $state.go('onboarding.backupRequest');
|
||||||
|
else $state.go('onboarding.notifications');
|
||||||
|
}
|
||||||
|
|
||||||
$scope.save = function(form) {
|
$scope.save = function(form) {
|
||||||
var wallet = profileService.getWallet($stateParams.walletId);
|
var wallet = profileService.getWallet($stateParams.walletId);
|
||||||
|
|
@ -10,7 +15,8 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
||||||
email: email,
|
email: email,
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err) $log.warn(err);
|
if (err) $log.warn(err);
|
||||||
$state.go('onboarding.notifications');
|
if (!platformInfo.isCordova) $state.go('onboarding.backupRequest');
|
||||||
|
else $state.go('onboarding.notifications');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, platformInfo) {
|
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, profileService) {
|
||||||
|
|
||||||
if (!platformInfo.isCordova) $state.go('onboarding.backupRequest');
|
|
||||||
|
|
||||||
$scope.allowNotif = function() {
|
$scope.allowNotif = function() {
|
||||||
// T O D O
|
profileService.pushNotificationsInit();
|
||||||
$state.go('onboarding.backupRequest');
|
$state.go('onboarding.backupRequest');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.controllers').controller('tourController',
|
angular.module('copayApp.controllers').controller('tourController',
|
||||||
function($scope, $stateParams, $state, $log, $timeout, ongoingProcess, storageService, profileService) {
|
function($scope, $state, $log, $timeout, ongoingProcess, profileService) {
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,12 @@ angular.module('copayApp.services')
|
||||||
root.profile = null;
|
root.profile = null;
|
||||||
|
|
||||||
Object.defineProperty(root, "focusedClient", {
|
Object.defineProperty(root, "focusedClient", {
|
||||||
get: function () { throw "focusedClient is not used any more" },
|
get: function() {
|
||||||
set: function () { throw "focusedClient is not used any more" }
|
throw "focusedClient is not used any more"
|
||||||
|
},
|
||||||
|
set: function() {
|
||||||
|
throw "focusedClient is not used any more"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -206,9 +210,6 @@ angular.module('copayApp.services')
|
||||||
}
|
}
|
||||||
|
|
||||||
bindWallets(function() {
|
bindWallets(function() {
|
||||||
if (usePushNotifications)
|
|
||||||
root.pushNotificationsInit();
|
|
||||||
|
|
||||||
root.isBound = true;
|
root.isBound = true;
|
||||||
|
|
||||||
lodash.each(root._queue, function(x) {
|
lodash.each(root._queue, function(x) {
|
||||||
|
|
@ -224,6 +225,8 @@ angular.module('copayApp.services')
|
||||||
if (!val) {
|
if (!val) {
|
||||||
return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
|
return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
|
||||||
}
|
}
|
||||||
|
if (usePushNotifications)
|
||||||
|
root.pushNotificationsInit();
|
||||||
$rootScope.$emit('disclaimerAccepted');
|
$rootScope.$emit('disclaimerAccepted');
|
||||||
return cb();
|
return cb();
|
||||||
});
|
});
|
||||||
|
|
@ -716,10 +719,11 @@ angular.module('copayApp.services')
|
||||||
ret = lodash.filter(ret, function(w) {
|
ret = lodash.filter(ret, function(w) {
|
||||||
return w.isComplete();
|
return w.isComplete();
|
||||||
});
|
});
|
||||||
} else {
|
} else {}
|
||||||
}
|
|
||||||
|
|
||||||
return lodash.sortBy(ret, [ function(x) { return x.isComplete(); }, 'createdOn']);
|
return lodash.sortBy(ret, [function(x) {
|
||||||
|
return x.isComplete();
|
||||||
|
}, 'createdOn']);
|
||||||
};
|
};
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue