Merge pull request #340 from jamal-jackson/feature/home_tip_improvements

made home tip persistent until user closes on home tab
This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-10 15:47:31 -03:00 committed by GitHub
commit a187de9631
2 changed files with 16 additions and 5 deletions

View file

@ -12,6 +12,12 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.name = $window.appConfig.nameCase;
$scope.homeTip = $stateParams.fromOnboarding;
if(!$scope.homeTip){
storageService.getHomeTipAccepted(function(error, value){
$scope.homeTip = (value == 'false') ? false : true;
});
}
$scope.openNotificationModal = function(n) {
wallet = profileService.getWallet(n.walletId);
@ -164,11 +170,8 @@ angular.module('copayApp.controllers').controller('tabHomeController',
};
$scope.hideHomeTip = function() {
$scope.homeTip = null;
$state.transitionTo($state.current, null, {
reload: true,
inherit: false,
notify: false
storageService.setHomeTipAccepted(false, function(error, value){
$scope.homeTip = false;
});
};

View file

@ -195,6 +195,14 @@ angular.module('copayApp.services')
storage.remove('config', cb);
};
root.getHomeTipAccepted = function(cb) {
storage.get('homeTip', cb);
};
root.setHomeTipAccepted = function(val, cb) {
storage.set('homeTip', val, cb);
};
root.setHideBalanceFlag = function(walletId, val, cb) {
storage.set('hideBalance-' + walletId, val, cb);
};