Merge pull request #4898 from gabrielbazan7/ref/backupNeeded

remove to show backup needed modal automatically when clicking on receive view
This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-26 14:31:08 -03:00 committed by GitHub
commit 384201841b
7 changed files with 8 additions and 45 deletions

View File

@ -131,7 +131,6 @@ angular.module('copayApp.controllers').controller('backupController',
}
profileService.setBackupFlag(wallet.credentials.walletId);
profileService.setBackupNeededModalFlag(wallet.credentials.walletId);
return cb();
}, 1);
};

View File

@ -4,7 +4,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.isCordova = platformInfo.isCordova;
$scope.isNW = platformInfo.isNW;
var showModalTimeout;
$scope.shareAddress = function(addr) {
if ($scope.generatingAddress) return;
@ -21,11 +20,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.generatingAddress = false;
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
$scope.addr = addr;
if ($scope.wallet.showBackupNeededModal) {
showModalTimeout = $timeout(function() {
$scope.openBackupNeededModal();
}, 2000);
}
$timeout(function() {
$scope.$apply();
}, 10);
@ -59,7 +53,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.close = function() {
$scope.BackupNeededModal.hide();
$scope.BackupNeededModal.remove();
profileService.setBackupNeededModalFlag($scope.wallet.credentials.walletId);
};
$scope.doBackup = function() {
@ -84,16 +77,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
return;
}
$scope.wallet = wallet;
$scope.generatingAddress = false;
$log.debug('Wallet changed: ' + wallet.name);
$timeout(function() {
$scope.setAddress();
$scope.setAddress(false);
}, 100);
});
$scope.$on("$ionicView.leave", function(event, data) {
$timeout.cancel(showModalTimeout);
});
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.wallets = profileService.getWallets();
});

View File

@ -38,22 +38,6 @@ 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) {
storageService.setBackupFlag(walletId, function(err) {
if (err) $log.error(err);
@ -117,11 +101,6 @@ angular.module('copayApp.services')
wallet.balanceHidden = val;
});
_showBackupNeededModal(wallet, function(val) {
if (wallet.needsBackup) wallet.showBackupNeededModal = val;
else wallet.showBackupNeededModal = false;
});
wallet.removeAllListeners();
wallet.on('report', function(n) {

View File

@ -373,15 +373,6 @@ angular.module('copayApp.services')
});
};
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) {
storage.set('amazonGiftCards-' + network, gcs, cb);
};

View File

@ -69,5 +69,9 @@
}
}
.modal-backdrop.active {
background: rgba(0, 0, 0, .8);
}
@import "backup-needed-modal";
@import "screenshot-warning-model";

View File

@ -7,7 +7,7 @@
<div class="popup-modal-heading" translate>Backup Needed</div>
<div class="popup-modal-message" translate>Now is a good time to backup your wallet. If this device is lost, it is impossible to access your funds without a backup.</div>
<button class="button button-clear" ng-click="doBackup()" translate>Backup now</button>
<button class="button button-secondary button-clear" ng-click="close()" translate>Remind me later</button>
<button class="button button-secondary button-clear" ng-click="close()" translate>I'll do it later</button>
</div>
</div>
</div>

View File

@ -46,7 +46,7 @@
</div>
</article>
<article ng-if="wallet && wallet.isComplete()">
<div class="row backup" ng-show="!wallet.showBackupNeededModal && wallet.needsBackup" ng-click="goToBackupFlow()">
<div class="row backup" ng-show="wallet.needsBackup" ng-click="openBackupNeededModal()">
<div class="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>
</div>