diff --git a/src/github.com/getlantern/lantern-ui/app/js/controllers.js b/src/github.com/getlantern/lantern-ui/app/js/controllers.js index 0d4ea0c6b..db11569b1 100644 --- a/src/github.com/getlantern/lantern-ui/app/js/controllers.js +++ b/src/github.com/getlantern/lantern-ui/app/js/controllers.js @@ -1,8 +1,8 @@ 'use strict'; -app.controller('RootCtrl', ['$scope', '$compile', '$window', '$http', +app.controller('RootCtrl', ['$rootScope', '$scope', '$compile', '$window', '$http', 'localStorageService', - function($scope, $compile, $window, $http, localStorageService) { + function($rootScope, $scope, $compile, $window, $http, localStorageService) { $scope.currentModal = 'none'; $scope.loadScript = function(src) { @@ -32,22 +32,22 @@ app.controller('RootCtrl', ['$scope', '$compile', '$window', '$http', $scope.currentModal = val; }; - $scope.lanternWelcomeKey = localStorageService.get('lanternWelcomeKey'); + $rootScope.lanternWelcomeKey = localStorageService.get('lanternWelcomeKey'); $scope.closeModal = function() { // if it's our first time opening the UI, // show the settings modal first immediately followed by // the welcome screen - if ($scope.currentModal == 'welcome' && !$scope.lanternWelcomeKey) { - $scope.lanternWelcomeKey = true; + if ($scope.currentModal == 'welcome' && !$rootScope.lanternWelcomeKey) { + $rootScope.lanternWelcomeKey = true; localStorageService.set('lanternWelcomeKey', true); } else { $scope.currentModal = 'none'; } }; - if (!$scope.lanternWelcomeKey) { + if (!$rootScope.lanternWelcomeKey) { $scope.showModal('welcome'); }; diff --git a/src/github.com/getlantern/lantern-ui/app/js/services.js b/src/github.com/getlantern/lantern-ui/app/js/services.js index 039e8d25d..fe892cfa5 100644 --- a/src/github.com/getlantern/lantern-ui/app/js/services.js +++ b/src/github.com/getlantern/lantern-ui/app/js/services.js @@ -77,7 +77,9 @@ angular.module('app.services', []) if (data.AutoReport) { model.settings.autoReport = true; - $rootScope.trackPageView(); + if ($rootScope.lanternWelcomeKey) { + $rootScope.trackPageView(); + } } },