hidden balance feature refactor
This commit is contained in:
parent
12b3808ade
commit
e73091ae46
4 changed files with 11 additions and 13 deletions
|
|
@ -175,16 +175,8 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
$scope.updateTxHistory(cb);
|
||||
}
|
||||
|
||||
var hideBalance = function() {
|
||||
storageService.getHideBalanceFlag(wallet.credentials.walletId, function(err, shouldHideBalance) {
|
||||
if (err) $scope.shouldHideBalance = false;
|
||||
else $scope.shouldHideBalance = (shouldHideBalance == 'true') ? true : false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.hideToggle = function() {
|
||||
$scope.shouldHideBalance = !$scope.shouldHideBalance;
|
||||
storageService.setHideBalanceFlag(wallet.credentials.walletId, $scope.shouldHideBalance.toString(), function() {});
|
||||
profileService.setHideBalanceFlag(wallet.credentials.walletId);
|
||||
}
|
||||
|
||||
var currentTxHistoryPage;
|
||||
|
|
@ -204,7 +196,6 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
$scope.requiresMultipleSignatures = wallet.credentials.m > 1;
|
||||
$scope.newTx = false;
|
||||
|
||||
hideBalance();
|
||||
$ionicNavBarDelegate.title(wallet.name);
|
||||
|
||||
$scope.updateAll(function() {
|
||||
|
|
|
|||
|
|
@ -727,5 +727,9 @@ angular.module('copayApp.services')
|
|||
}, 'createdOn']);
|
||||
};
|
||||
|
||||
root.setHideBalanceFlag = function(walletId) {
|
||||
root.wallet[walletId].balanceHidden = !root.wallet[walletId].balanceHidden;
|
||||
}
|
||||
|
||||
return root;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue