diff --git a/public/index.html b/public/index.html index 36afe3f95..cd4ada852 100644 --- a/public/index.html +++ b/public/index.html @@ -19,12 +19,11 @@ - + - diff --git a/public/views/includes/topbar.html b/public/views/includes/topbar.html index e47b1c061..6feeafdef 100644 --- a/public/views/includes/topbar.html +++ b/public/views/includes/topbar.html @@ -1,7 +1,7 @@ - diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js index d125f8d06..388906ab7 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($rootScope, $scope, $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..0fc126499 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -18,7 +18,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r ret.historyShowMoreLimit = 10; ret.isSearching = false; ret.prevState = 'walletHome'; - ret.physicalScreenWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width); ret.menu = [{ 'title': gettext('Receive'), @@ -61,6 +60,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); } + $timeout(function() { + $scope.physicalScreenWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width) < 768; + profileService.isDisclaimerAccepted(function(val) { + $scope.isDisclaimerAccepted = val; + }); + }, 1); + function strip(number) { return (parseFloat(number.toPrecision(12))); }; @@ -1410,6 +1416,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.tab = 'walletHome'; }); + $rootScope.$on('disclaimerAccepted', function(event) { + profileService.isDisclaimerAccepted(function(val) { + $scope.isDisclaimerAccepted = val; + }); + }); + $rootScope.$on('Local/ValidatingWalletEnded', function(ev, walletId, isOK) { if (self.isInFocus(walletId)) { @@ -1673,7 +1685,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); $rootScope.$on('Local/WindowResize', function() { - self.physicalScreenWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width); + $scope.physicalScreenWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width) < 768; }); $rootScope.$on('Local/NeedsConfirmation', function(event, txp, cb) {