add backup warning view to backup flow
This commit is contained in:
parent
82211a5812
commit
33c7e2b297
17 changed files with 123 additions and 72 deletions
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
|
@ -1,10 +1,10 @@
|
||||||
<ion-view id="wallet-backup-phrase" title="{{viewTitle}}">
|
<ion-view id="wallet-backup-phrase">
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
<ion-nav-buttons side="primary">
|
<ion-nav-title>
|
||||||
<button class="button button-back button-clear" ng-click="backupGoBack()">
|
{{viewTitle}}
|
||||||
<i class="icon ion-ios-arrow-thin-left"></i>
|
</ion-nav-title>
|
||||||
</button>
|
<ion-nav-back-button>
|
||||||
</ion-nav-buttons>
|
</ion-nav-back-button>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<div class="ng-hide" ng-show="deleted">
|
<div class="ng-hide" ng-show="deleted">
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<ion-view id="onboarding-backup-warning" class="onboarding" ng-controller="backupWarningController">
|
<ion-view id="backup-warning" class="onboarding" ng-controller="backupWarningController">
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
<ion-nav-buttons side="primary">
|
<ion-nav-buttons side="primary">
|
||||||
<button class="button button-back button-clear" href ui-sref="onboarding.backupRequest({walletId: walletId})">
|
<button class="button button-back button-clear" ng-click="goBack()">
|
||||||
<i class="icon ion-ios-arrow-thin-left"></i>
|
<i class="icon ion-ios-arrow-thin-left"></i>
|
||||||
</button>
|
</button>
|
||||||
</ion-nav-buttons>
|
</ion-nav-buttons>
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<img src="img/onboarding-backup-warning.svg" class="col col-60 warning-image">
|
<img src="img/backup-warning.svg" class="col col-60 warning-image">
|
||||||
</div>
|
</div>
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
<p class="col col-60">
|
<p class="col col-60">
|
||||||
|
|
@ -10,14 +10,14 @@
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button
|
<button
|
||||||
class="button button-clear expand"
|
class="button button-clear expand"
|
||||||
ng-click="closeBackupNeededModal()"
|
ng-click="close()"
|
||||||
translate>Not now
|
translate>Not now
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button
|
<button
|
||||||
class="button button-clear expand"
|
class="button button-clear expand"
|
||||||
ng-click="goToBackupFlow()"
|
ng-click="doBackup()"
|
||||||
translate>Backup wallet now
|
translate>Backup wallet now
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<div class="cta-buttons">
|
<div class="cta-buttons">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button class="button button-block button-positive col-75 col" href
|
<button class="button button-block button-positive col-75 col" href
|
||||||
ui-sref="onboarding.backupWarning({walletId: walletId})" translate>Backup wallet</button>
|
ui-sref="onboarding.backupWarning({from: 'onboarding.backupRequest', walletId: walletId})" translate>Backup wallet</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button class="button button-block button-transparent col-75 col" ng-click="openPopup()" translate>I'll backup my wallet later</button>
|
<button class="button button-block button-transparent col-75 col" ng-click="openPopup()" translate>I'll backup my wallet later</button>
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
<div class="item item-divider" translate>
|
<div class="item item-divider" translate>
|
||||||
Security
|
Security
|
||||||
</div>
|
</div>
|
||||||
<a class="item item-icon-right" ui-sref="tabs.preferences.backup" ng-hide="wallet.isPrivKeyExternal()">
|
<a class="item item-icon-right" ui-sref="tabs.preferences.backupWarning({from: 'tabs.preferences'})" ng-hide="wallet.isPrivKeyExternal()">
|
||||||
<span translate>Backup</span>
|
<span translate>Backup</span>
|
||||||
<i class="icon nav-item-arrow-right"></i>
|
<i class="icon nav-item-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<article ng-if="wallet.isComplete()">
|
<article ng-if="wallet.isComplete()">
|
||||||
<div class="row backup" ng-click="openBackupNeededPopup()">
|
<div class="row backup" ng-show="!wallet.showBackupNeededModal" ng-click="goToBackupFlow()">
|
||||||
<div class="m15t text-center col center-block">
|
<div class="m15t text-center col center-block">
|
||||||
<i class="icon ion-alert"></i><span translate>Wallet not backed up</span><i class="icon ion-ios-arrow-thin-right"></i>
|
<i class="icon ion-alert"></i><span translate>Wallet not backed up</span><i class="icon ion-ios-arrow-thin-right"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -84,13 +84,15 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
|
|
||||||
$scope.closeBackupResultModal = function() {
|
$scope.closeBackupResultModal = function() {
|
||||||
$scope.confirmBackupModal.hide();
|
$scope.confirmBackupModal.hide();
|
||||||
|
$scope.confirmBackupModal.remove();
|
||||||
|
|
||||||
if ($stateParams.fromOnboarding) {
|
profileService.isDisclaimerAccepted(function(val) {
|
||||||
$state.go('onboarding.disclaimer');
|
if (val) {
|
||||||
} else {
|
$ionicHistory.removeBackView();
|
||||||
$ionicHistory.removeBackView();
|
$state.go('tabs.home');
|
||||||
$state.go('tabs.home');
|
}
|
||||||
}
|
else $state.go('onboarding.disclaimer');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var confirm = function(cb) {
|
var confirm = function(cb) {
|
||||||
|
|
@ -184,17 +186,6 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
$scope.selectComplete = false;
|
$scope.selectComplete = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.backupGoBack = function() {
|
|
||||||
if ($stateParams.fromOnboarding) $state.go('onboarding.backupWarning', {
|
|
||||||
walletId: $stateParams.walletId,
|
|
||||||
fromOnboarding: true
|
|
||||||
});
|
|
||||||
else if ($stateParams.fromReceive) $state.go('tabs.receive');
|
|
||||||
else $state.go('tabs.preferences', {
|
|
||||||
walletId: $stateParams.walletId
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.$on("$ionicView.enter", function(event, data) {
|
$scope.$on("$ionicView.enter", function(event, data) {
|
||||||
$scope.deleted = isDeletedSeed();
|
$scope.deleted = isDeletedSeed();
|
||||||
if ($scope.deleted) {
|
if ($scope.deleted) {
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,31 @@ angular.module('copayApp.controllers').controller('backupWarningController', fun
|
||||||
$scope.walletId = $stateParams.walletId;
|
$scope.walletId = $stateParams.walletId;
|
||||||
$scope.openPopup = function() {
|
$scope.openPopup = function() {
|
||||||
$ionicModal.fromTemplateUrl('views/includes/screenshotWarningModal.html', {
|
$ionicModal.fromTemplateUrl('views/includes/screenshotWarningModal.html', {
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
backdropClickToClose: false,
|
backdropClickToClose: false,
|
||||||
hardwareBackButtonClose: false
|
hardwareBackButtonClose: false
|
||||||
}).then(function(modal) {
|
}).then(function(modal) {
|
||||||
$scope.warningModal = modal;
|
$scope.warningModal = modal;
|
||||||
$scope.warningModal.show();
|
$scope.warningModal.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.close = function() {
|
$scope.close = function() {
|
||||||
$scope.warningModal.hide();
|
$scope.warningModal.hide();
|
||||||
$state.go('onboarding.backup', {
|
if ($stateParams.from == 'onboarding.backupRequest')
|
||||||
walletId: $stateParams.walletId,
|
$state.go('onboarding.backup', {
|
||||||
fromOnboarding: true
|
walletId: $stateParams.walletId
|
||||||
});
|
});
|
||||||
|
else
|
||||||
|
$state.go($stateParams.from + '.backup', {
|
||||||
|
walletId: $stateParams.walletId
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.goBack = function() {
|
||||||
|
$state.go($stateParams.from, {
|
||||||
|
walletId: $stateParams.walletId
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
||||||
$scope.wallet = wallet;
|
$scope.wallet = wallet;
|
||||||
$log.debug('Wallet changed: ' + wallet.name);
|
$log.debug('Wallet changed: ' + wallet.name);
|
||||||
$scope.setAddress();
|
$scope.setAddress();
|
||||||
|
if ($scope.wallet.showBackupNeededModal) $scope.openBackupNeededModal();
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -71,28 +72,32 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.openBackupNeededPopup = function() {
|
$scope.openBackupNeededModal = function() {
|
||||||
$ionicModal.fromTemplateUrl('views/includes/backupNeededPopup.html', {
|
$ionicModal.fromTemplateUrl('views/includes/backupNeededPopup.html', {
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
backdropClickToClose: false,
|
backdropClickToClose: false,
|
||||||
hardwareBackButtonClose: false
|
hardwareBackButtonClose: false
|
||||||
}).then(function(modal) {
|
}).then(function(modal) {
|
||||||
$scope.BackupNeededPopup = modal;
|
$scope.BackupNeededModal = modal;
|
||||||
$scope.BackupNeededPopup.show();
|
$scope.BackupNeededModal.show();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.closeBackupNeededModal = function() {
|
$scope.close = function() {
|
||||||
$scope.BackupNeededPopup.hide();
|
$scope.BackupNeededModal.hide();
|
||||||
$scope.BackupNeededPopup.remove();
|
$scope.BackupNeededModal.remove();
|
||||||
|
profileService.setBackupNeededModalFlag($scope.wallet.credentials.walletId);
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.doBackup = function() {
|
||||||
|
$scope.close();
|
||||||
|
$scope.goToBackupFlow();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.goToBackupFlow = function() {
|
$scope.goToBackupFlow = function() {
|
||||||
$scope.BackupNeededPopup.hide();
|
$state.go('tabs.receive.backupWarning', {
|
||||||
$scope.BackupNeededPopup.remove();
|
from: 'tabs.receive',
|
||||||
$state.go('tabs.receive.backup', {
|
|
||||||
fromReceive: true,
|
|
||||||
walletId: $scope.wallet.credentials.walletId
|
walletId: $scope.wallet.credentials.walletId
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -432,6 +432,14 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.state('tabs.preferences.backupWarning', {
|
||||||
|
url: '/backupWarning/:from',
|
||||||
|
views: {
|
||||||
|
'tab-settings@tabs': {
|
||||||
|
templateUrl: 'views/backupWarning.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
.state('tabs.preferences.backup', {
|
.state('tabs.preferences.backup', {
|
||||||
url: '/backup',
|
url: '/backup',
|
||||||
views: {
|
views: {
|
||||||
|
|
@ -571,15 +579,23 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.state('tabs.receive.backup', {
|
.state('tabs.receive.backupWarning', {
|
||||||
url: '/backup/:fromReceive/:walletId',
|
url: '/backupWarning/:from/:walletId',
|
||||||
views: {
|
views: {
|
||||||
'tab-receive@tabs': {
|
'tab-receive@tabs': {
|
||||||
controller: 'backupController',
|
templateUrl: 'views/backupWarning.html'
|
||||||
templateUrl: 'views/backup.html'
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
.state('tabs.receive.backup', {
|
||||||
|
url: '/backup/:walletId',
|
||||||
|
views: {
|
||||||
|
'tab-receive@tabs': {
|
||||||
|
controller: 'backupController',
|
||||||
|
templateUrl: 'views/backup.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
@ -633,15 +649,15 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('onboarding.backupWarning', {
|
.state('onboarding.backupWarning', {
|
||||||
url: '/backupWarning/:walletId',
|
url: '/backupWarning/:from/:walletId',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/onboarding/backupWarning.html'
|
templateUrl: 'views/backupWarning.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('onboarding.backup', {
|
.state('onboarding.backup', {
|
||||||
url: '/backup/:walletId/:fromOnboarding',
|
url: '/backup/:walletId',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/backup.html',
|
templateUrl: 'views/backup.html',
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,22 @@ angular.module('copayApp.services')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
root.setBackupNeededModalFlag = function(walletId) {
|
||||||
|
storageService.setBackupNeededModalFlag(walletId, true, function(err) {
|
||||||
|
if (err) $log.error(err);
|
||||||
|
$log.debug('Backup warning modal flag stored');
|
||||||
|
root.wallet[walletId].showBackupNeededModal = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function _showBackupNeededModal(wallet, cb) {
|
||||||
|
storageService.getBackupNeededModalFlag(wallet.credentials.walletId, function(err, val) {
|
||||||
|
if (err) $log.error(err);
|
||||||
|
if (val) return cb(false);
|
||||||
|
return cb(true);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
root.setBackupFlag = function(walletId) {
|
root.setBackupFlag = function(walletId) {
|
||||||
storageService.setBackupFlag(walletId, function(err) {
|
storageService.setBackupFlag(walletId, function(err) {
|
||||||
if (err) $log.error(err);
|
if (err) $log.error(err);
|
||||||
|
|
@ -101,6 +117,10 @@ angular.module('copayApp.services')
|
||||||
wallet.balanceHidden = val;
|
wallet.balanceHidden = val;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_showBackupNeededModal(wallet, function(val) {
|
||||||
|
wallet.showBackupNeededModal = val;
|
||||||
|
});
|
||||||
|
|
||||||
wallet.removeAllListeners();
|
wallet.removeAllListeners();
|
||||||
|
|
||||||
wallet.on('report', function(n) {
|
wallet.on('report', function(n) {
|
||||||
|
|
|
||||||
|
|
@ -365,6 +365,14 @@ angular.module('copayApp.services')
|
||||||
storage.get('receiveTips', cb);
|
storage.get('receiveTips', cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
root.setBackupNeededModalFlag = function(walletId, val, cb) {
|
||||||
|
storage.set('showBackupNeededModal-' + walletId, val, cb);
|
||||||
|
};
|
||||||
|
|
||||||
|
root.getBackupNeededModalFlag = function(walletId, cb) {
|
||||||
|
storage.get('showBackupNeededModal-' + walletId, cb);
|
||||||
|
};
|
||||||
|
|
||||||
root.setAmazonGiftCards = function(network, gcs, cb) {
|
root.setAmazonGiftCards = function(network, gcs, cb) {
|
||||||
storage.set('amazonGiftCards-' + network, gcs, cb);
|
storage.set('amazonGiftCards-' + network, gcs, cb);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#onboarding-backup-warning{
|
#backup-warning{
|
||||||
.warning{
|
.warning{
|
||||||
margin:4rem auto 1rem;
|
margin:4rem auto 1rem;
|
||||||
height: 11rem;
|
height: 11rem;
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 400px){
|
@media (max-width: 400px){
|
||||||
#onboarding-backup-warning{
|
#backup-warning{
|
||||||
.warning{
|
.warning{
|
||||||
margin: 2rem auto 1rem;
|
margin: 2rem auto 1rem;
|
||||||
height: 8rem;
|
height: 8rem;
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (max-height: 540px){
|
@media (max-height: 540px){
|
||||||
#onboarding-backup-warning{
|
#backup-warning{
|
||||||
.cta-buttons{
|
.cta-buttons{
|
||||||
float:left;
|
float:left;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#screenshot-warning-modal{
|
#screenshot-warning-modal{
|
||||||
.popup-modal-header{
|
.popup-modal-header{
|
||||||
&-img{
|
&-img{
|
||||||
background-image: url('../img/onboarding-no-screenshot.svg');
|
background-image: url('../img/no-screenshot.svg');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -112,6 +112,6 @@
|
||||||
@import "onboard-tour";
|
@import "onboard-tour";
|
||||||
@import "onboard-collect-email";
|
@import "onboard-collect-email";
|
||||||
@import "onboard-backup-request";
|
@import "onboard-backup-request";
|
||||||
@import "onboard-backup-warning";
|
@import "../backup-warning";
|
||||||
@import "onboard-disclaimer";
|
@import "onboard-disclaimer";
|
||||||
@import "onboard-push-notifications";
|
@import "onboard-push-notifications";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue