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.setBackupFlag(wallet.credentials.walletId);
profileService.setBackupNeededModalFlag(wallet.credentials.walletId);
return cb(); return cb();
}, 1); }, 1);
}; };

View File

@ -4,7 +4,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
$scope.isNW = platformInfo.isNW; $scope.isNW = platformInfo.isNW;
var showModalTimeout;
$scope.shareAddress = function(addr) { $scope.shareAddress = function(addr) {
if ($scope.generatingAddress) return; if ($scope.generatingAddress) return;
@ -21,11 +20,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.generatingAddress = false; $scope.generatingAddress = false;
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err); if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
$scope.addr = addr; $scope.addr = addr;
if ($scope.wallet.showBackupNeededModal) {
showModalTimeout = $timeout(function() {
$scope.openBackupNeededModal();
}, 2000);
}
$timeout(function() { $timeout(function() {
$scope.$apply(); $scope.$apply();
}, 10); }, 10);
@ -59,7 +53,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.close = function() { $scope.close = function() {
$scope.BackupNeededModal.hide(); $scope.BackupNeededModal.hide();
$scope.BackupNeededModal.remove(); $scope.BackupNeededModal.remove();
profileService.setBackupNeededModalFlag($scope.wallet.credentials.walletId);
}; };
$scope.doBackup = function() { $scope.doBackup = function() {
@ -84,16 +77,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
return; return;
} }
$scope.wallet = wallet; $scope.wallet = wallet;
$scope.generatingAddress = false;
$log.debug('Wallet changed: ' + wallet.name); $log.debug('Wallet changed: ' + wallet.name);
$timeout(function() { $timeout(function() {
$scope.setAddress(); $scope.setAddress(false);
}, 100); }, 100);
}); });
$scope.$on("$ionicView.leave", function(event, data) {
$timeout.cancel(showModalTimeout);
});
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.wallets = profileService.getWallets(); $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) { root.setBackupFlag = function(walletId) {
storageService.setBackupFlag(walletId, function(err) { storageService.setBackupFlag(walletId, function(err) {
if (err) $log.error(err); if (err) $log.error(err);
@ -117,11 +101,6 @@ angular.module('copayApp.services')
wallet.balanceHidden = val; wallet.balanceHidden = val;
}); });
_showBackupNeededModal(wallet, function(val) {
if (wallet.needsBackup) wallet.showBackupNeededModal = val;
else wallet.showBackupNeededModal = false;
});
wallet.removeAllListeners(); wallet.removeAllListeners();
wallet.on('report', function(n) { 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) { root.setAmazonGiftCards = function(network, gcs, cb) {
storage.set('amazonGiftCards-' + 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 "backup-needed-modal";
@import "screenshot-warning-model"; @import "screenshot-warning-model";

View File

@ -7,7 +7,7 @@
<div class="popup-modal-heading" translate>Backup Needed</div> <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> <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-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> </div>
</div> </div>

View File

@ -46,7 +46,7 @@
</div> </div>
</article> </article>
<article ng-if="wallet && wallet.isComplete()"> <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"> <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> <i class="icon ion-alert"></i><span translate>Wallet not backed up</span><i class="icon ion-ios-arrow-thin-right"></i>
</div> </div>