diff --git a/public/index.html b/public/index.html index 4378640a5..3e763dc79 100644 --- a/public/index.html +++ b/public/index.html @@ -18,7 +18,7 @@ ng-controller="indexController as index" ng-swipe-disable-mouse ng-swipe-left="index.closeMenu()" - ng-swipe-right="index.agreeDisclaimer ? index.openMenu() : null"> + ng-swipe-right="index.agreeDisclaimer() ? index.openMenu() : null">
diff --git a/public/views/termOfUse.html b/public/views/termOfUse.html index 33804766d..506a2a3fa 100644 --- a/public/views/termOfUse.html +++ b/public/views/termOfUse.html @@ -1,18 +1,16 @@ -
- diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 0ce9873c1..acdf30dff 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -135,9 +135,14 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.openWallet(); }); } - storageService.getProfile(function(err, profile) { - self.agreeDisclaimer = profile.agreeDisclaimer; - }); + }); + }; + + self.agreeDisclaimer = function() { + storageService.getProfile(function(err, profile) { + if (profile && profile.agreeDisclaimer) + return profile.agreeDisclaimer; + return null; }); }; @@ -1328,8 +1333,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on('Local/NewFocusedWallet', function() { self.setFocusedWallet(); self.updateTxHistory(); - storageService.getProfile(function(err, val) { - if (val.agreeDisclaimer) go.walletHome(); + storageService.getProfile(function(err, profile) { + if (profile && profile.agreeDisclaimer) go.walletHome(); storageService.getCleanAndScanAddresses(function(err, walletId) { if (walletId && profileService.walletClients[walletId]) { $log.debug('Clear last address cache and Scan ', walletId);