Merge pull request #5899 from cmgustavo/ref/removes-notification-screen
Removes notification screen from onboarding. Also removes unused/old …
This commit is contained in:
commit
f4526a5f4d
8 changed files with 11 additions and 120 deletions
|
|
@ -1,10 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('backController', function($scope, $state, $stateParams, platformInfo) {
|
||||
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var isWP = platformInfo.isWP;
|
||||
var usePushNotifications = isCordova && !isWP;
|
||||
angular.module('copayApp.controllers').controller('backController', function($scope, $state, $stateParams) {
|
||||
|
||||
$scope.importGoBack = function() {
|
||||
if ($stateParams.fromOnboarding) $state.go('onboarding.welcome');
|
||||
|
|
@ -12,8 +8,7 @@ angular.module('copayApp.controllers').controller('backController', function($sc
|
|||
};
|
||||
|
||||
$scope.onboardingMailSkip = function() {
|
||||
if (!usePushNotifications) $state.go('onboarding.backupRequest');
|
||||
else $state.go('onboarding.notifications');
|
||||
$state.go('onboarding.backupRequest');
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, walletService, platformInfo, pushNotificationsService) {
|
||||
angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, walletService) {
|
||||
|
||||
$scope.$on("$ionicView.beforeLeave", function() {
|
||||
$ionicConfig.views.swipeBackEnabled(true);
|
||||
|
|
@ -10,11 +10,6 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
|||
$ionicConfig.views.swipeBackEnabled(false);
|
||||
});
|
||||
|
||||
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;
|
||||
$scope.data = {};
|
||||
|
|
@ -37,20 +32,9 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
|||
};
|
||||
|
||||
$scope.goNextView = function() {
|
||||
if (!usePushNotifications) {
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
} else if (requiresOptIn) {
|
||||
$state.go('onboarding.notifications', {
|
||||
walletId: walletId
|
||||
});
|
||||
} else {
|
||||
pushNotificationsService.init();
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
}
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
};
|
||||
|
||||
$scope.confirm = function(emailForm) {
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, $interval, pushNotificationsService) {
|
||||
|
||||
$scope.$on("$ionicView.enter", function() {
|
||||
$ionicConfig.views.swipeBackEnabled(false);
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.beforeLeave", function() {
|
||||
$ionicConfig.views.swipeBackEnabled(true);
|
||||
});
|
||||
|
||||
$scope.walletId = $stateParams.walletId;
|
||||
|
||||
$scope.allowNotif = function() {
|
||||
$scope.notificationDialogOpen = true;
|
||||
$timeout(function() {
|
||||
pushNotificationsService.init();
|
||||
});
|
||||
$scope.notificationPromise = $interval(function() {
|
||||
PushNotification.hasPermission(function(data) {
|
||||
if (data.isEnabled) {
|
||||
$interval.cancel($scope.notificationPromise);
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: $scope.walletId
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
$scope.continue = function() {
|
||||
$interval.cancel($scope.notificationPromise);
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: $scope.walletId
|
||||
});
|
||||
}
|
||||
|
||||
$scope.disableNotif = function() {
|
||||
var opts = {
|
||||
pushNotifications: {
|
||||
enabled: false
|
||||
}
|
||||
};
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: $scope.walletId
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
@ -1,10 +1,6 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.controllers').controller('tourController',
|
||||
function($scope, $state, $log, $timeout, $filter, ongoingProcess, platformInfo, profileService, rateService, popupService, gettextCatalog) {
|
||||
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var isWP = platformInfo.isWP;
|
||||
var usePushNotifications = isCordova && !isWP;
|
||||
function($scope, $state, $log, $timeout, $filter, ongoingProcess, profileService, rateService, popupService, gettextCatalog) {
|
||||
|
||||
$scope.data = {
|
||||
index: 0
|
||||
|
|
@ -66,15 +62,9 @@ angular.module('copayApp.controllers').controller('tourController',
|
|||
ongoingProcess.set('creatingWallet', false);
|
||||
var wallet = walletClient;
|
||||
var walletId = wallet.credentials.walletId;
|
||||
if (!usePushNotifications) {
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
} else {
|
||||
$state.go('onboarding.notifications', {
|
||||
walletId: walletId
|
||||
});
|
||||
}
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -777,15 +777,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
}
|
||||
}
|
||||
})
|
||||
.state('onboarding.notifications', {
|
||||
url: '/notifications/:walletId',
|
||||
views: {
|
||||
'onboarding': {
|
||||
templateUrl: 'views/onboarding/notifications.html',
|
||||
controller: 'notificationsController'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('onboarding.backupRequest', {
|
||||
url: '/backupRequest/:walletId',
|
||||
views: {
|
||||
|
|
@ -1176,12 +1167,11 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
var matchWelcome = $ionicHistory.currentStateName() == 'onboarding.welcome' ? true : false;
|
||||
var matchCollectEmail = $ionicHistory.currentStateName() == 'onboarding.collectEmail' ? true : false;
|
||||
var matchBackupRequest = $ionicHistory.currentStateName() == 'onboarding.backupRequest' ? true : false;
|
||||
var matchNotifications = $ionicHistory.currentStateName() == 'onboarding.notifications' ? true : false;
|
||||
var backedUp = $ionicHistory.backView().stateName == 'onboarding.backup' ? true : false;
|
||||
var noBackView = $ionicHistory.backView().stateName == 'starting' ? true : false;
|
||||
var matchDisclaimer = $ionicHistory.currentStateName() == 'onboarding.disclaimer' && (backedUp || noBackView) ? true : false;
|
||||
|
||||
var fromOnboarding = matchCollectEmail | matchBackupRequest | matchNotifications | matchWelcome | matchDisclaimer;
|
||||
var fromOnboarding = matchCollectEmail | matchBackupRequest | matchWelcome | matchDisclaimer;
|
||||
|
||||
//views with disable backbutton
|
||||
var matchComplete = $ionicHistory.currentStateName() == 'tabs.rate.complete' ? true : false;
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ $v-onboarding-checkbox-on-border: $v-success-color !default;
|
|||
$v-onboarding-tour-phone-bg: url(../img/onboarding-tour-phone.svg) !default;
|
||||
$v-onboarding-tour-currency-bg: url(../img/onboarding-tour-currency-bg.svg) !default;
|
||||
$v-onboarding-tour-control-bg: url(../img/onboarding-tour-control.svg) !default;
|
||||
$v-onboarding-push-notification-bg: url(../img/onboarding-push-notifications.svg) !default;
|
||||
$v-onboarding-backup-warning-bg: url(../img/backup-warning.svg) !default;
|
||||
|
||||
$v-onboarding-button-back-color: #ffffff !default;
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
#onboarding-push-notifications {
|
||||
#notifications-topic {
|
||||
margin-top: 3rem;
|
||||
}
|
||||
#cta-buttons {
|
||||
@extend %cta-buttons;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
|
|
@ -82,7 +82,6 @@
|
|||
@import "onboard-backup-request";
|
||||
@import "../backup-warning";
|
||||
@import "onboard-disclaimer";
|
||||
@import "onboard-push-notifications";
|
||||
|
||||
%onboarding-illustration {
|
||||
width: 100%;
|
||||
|
|
@ -124,10 +123,6 @@
|
|||
@extend %onboarding-illustration;
|
||||
background-image: $v-onboarding-tour-control-bg;
|
||||
}
|
||||
&-notifications {
|
||||
@extend %onboarding-illustration;
|
||||
background-image: $v-onboarding-push-notification-bg;
|
||||
}
|
||||
&-backup-warning {
|
||||
@extend %onboarding-illustration;
|
||||
background-image: $v-onboarding-backup-warning-bg;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue