From c54a6c0875bbe651a345d2def0ce1fd09e084b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 11 Jul 2016 10:06:09 -0300 Subject: [PATCH] hide menu in accept terms view --- public/index.html | 2 +- src/js/controllers/disclaimer.js | 3 ++- src/js/controllers/index.js | 4 ++++ src/js/services/profileService.js | 5 +++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index 36afe3f95..3f70a663a 100644 --- a/public/index.html +++ b/public/index.html @@ -19,7 +19,7 @@ - +
diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js index d125f8d06..261032579 100644 --- a/src/js/controllers/disclaimer.js +++ b/src/js/controllers/disclaimer.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('disclaimerController', - function($scope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, go, storageService, gettext, platformInfo, ongoingProcess) { + function($scope, $rootScope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, go, storageService, gettext, platformInfo, ongoingProcess) { var self = this; self.tries = 0; var isCordova = platformInfo.isCordova; @@ -62,6 +62,7 @@ angular.module('copayApp.controllers').controller('disclaimerController', if (err) $log.error(err); else { $ionicSideMenuDelegate.canDragContent(true); + $rootScope.$emit('disclaimerAccepted'); go.walletHome(); } }); diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 8e84d190a..617c42220 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -1672,6 +1672,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.setTab(tab, reset); }); + $rootScope.$on('disclaimerAccepted', function(event) { + $scope.isDisclaimerAccepted = true; + }); + $rootScope.$on('Local/WindowResize', function() { self.physicalScreenWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width); }); diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 2e4a8dc7d..f2b4f31c4 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -226,6 +226,7 @@ angular.module('copayApp.services') if (!val) { return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer')); } + $rootScope.$emit('disclaimerAccepted'); return cb(); }); }); @@ -405,8 +406,8 @@ angular.module('copayApp.services') // check if exist if (lodash.find(root.profile.credentials, { - 'walletId': walletData.walletId - })) { + 'walletId': walletData.walletId + })) { return cb(gettext('Cannot join the same wallet more that once')); } } catch (ex) {