tap to lock balance

This commit is contained in:
Gabriel Bazán 2016-05-13 15:05:43 -03:00 committed by Javier
commit efa36915e1
3 changed files with 30 additions and 2 deletions

View file

@ -69,6 +69,18 @@ angular.module('copayApp.controllers').controller('indexController', function($r
go.walletHome();
};
self.hideBalance = function() {
storageService.getHideBalanceFlag(self.walletId, function(err, shouldHideBalance) {
if (err) self.shouldHideBalance = false;
else self.shouldHideBalance = (shouldHideBalance == 'true') ? true : false;
});
}
self.onHold = function(){
self.shouldHideBalance = !self.shouldHideBalance;
storageService.setHideBalanceFlag(self.walletId, self.shouldHideBalance, function() {});
}
self.setOngoingProcess = function(processName, isOn) {
$log.debug('onGoingProcess', processName, isOn);
self[processName] = isOn;
@ -153,6 +165,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.initGlidera();
self.initCoinbase();
self.hideBalance();
self.setCustomBWSFlag();
if (!self.isComplete) {

View file

@ -200,6 +200,14 @@ angular.module('copayApp.services')
storage.remove('config', cb);
};
root.setHideBalanceFlag = function(walletId, val, cb) {
storage.set('hideBalance-' + walletId, val, cb);
};
root.getHideBalanceFlag = function(walletId, cb) {
storage.get('hideBalance-' + walletId, cb);
};
//for compatibility
root.getCopayDisclaimerFlag = function(cb) {
storage.get('agreeDisclaimer', cb);