diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index e13111622..937e1bab6 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -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; }); }; diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index fc21e4059..f9f14fdf7 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -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); };