From 2681cd6178ff054eef47fba398d3cf5ddf1d9237 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 3 Dec 2014 03:35:45 -0300 Subject: [PATCH] Display PIN form only on mobile devices --- js/controllers/home.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/controllers/home.js b/js/controllers/home.js index 4b8993537..8993040b0 100644 --- a/js/controllers/home.js +++ b/js/controllers/home.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, $timeout, notification, identityService, Compatibility, pinService, applicationService) { +angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, $timeout, notification, identityService, Compatibility, pinService, applicationService, isMobile) { $scope.init = function() { // This is only for backwards compat, insight api should link to #!/confirmed directly @@ -20,9 +20,11 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc } Compatibility.check($scope); - pinService.check(function(err, value) { - $scope.hasPin = value; - }); + if (isMobile.any()) { + pinService.check(function(err, value) { + $scope.hasPin = value; + }); + } }; Object.defineProperty($scope, @@ -131,7 +133,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc $scope.error = 'Please enter the required fields'; return; } - if (!$scope.hasPin) { + if (isMobile.any() && !$scope.hasPin) { $scope.email = form.email.$modelValue; $scope.password = form.password.$modelValue; $scope.setPin = true;