made home tip persistent until user closes

This commit is contained in:
Jamal Jackson 2016-10-10 13:06:29 -04:00
commit b23da0aa11
2 changed files with 21 additions and 5 deletions

View file

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

View file

@ -195,6 +195,14 @@ angular.module('copayApp.services')
storage.remove('config', cb); 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) { root.setHideBalanceFlag = function(walletId, val, cb) {
storage.set('hideBalance-' + walletId, val, cb); storage.set('hideBalance-' + walletId, val, cb);
}; };