Skip to content

Commit

Permalink
remove popup confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
JDonadio committed Apr 20, 2017
1 parent 328ec33 commit 6b4b675
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/js/controllers/lockSetup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

angular.module('copayApp.controllers').controller('lockSetupController', function($state, $scope, $timeout, $log, configService, popupService, gettextCatalog, appConfigService, fingerprintService, profileService, lodash) {
angular.module('copayApp.controllers').controller('lockSetupController', function($state, $scope, $timeout, $log, configService, gettextCatalog, fingerprintService, profileService, lodash) {

function init() {
$scope.options = [
Expand Down Expand Up @@ -97,37 +97,21 @@ angular.module('copayApp.controllers').controller('lockSetupController', functio
locking: false,
});
else saveConfig();
} else if (selectedMethod == 'fingerprint') {
if (savedMethod == 'pin') {
askForDisablePin(function(disablePin) {
if (disablePin) saveConfig('fingerprint');
else init();
});
} else saveConfig('fingerprint');
} else if (selectedMethod == 'pin') {
if (savedMethod == 'pin') return;
$state.transitionTo('tabs.pin', {
fromSettings: true,
locking: savedMethod == 'pin' ? false : true
});
} else if (selectedMethod == 'fingerprint') {
if (savedMethod == 'fingerprint') return;
else saveConfig('fingerprint');
}
$timeout(function() {
$scope.$apply();
});
};

function askForDisablePin(cb) {
var message = gettextCatalog.getString('{{appName}} startup is locked by PIN. Are you sure you want to disable it?', {
appName: appConfigService.nameCase
});
var okText = gettextCatalog.getString('Continue');
var cancelText = gettextCatalog.getString('Cancel');
popupService.showConfirm(null, message, okText, cancelText, function(ok) {
if (!ok) return cb(false);
return cb(true);
});
};

function saveConfig(method) {
var opts = {
lock: {
Expand Down

0 comments on commit 6b4b675

Please sign in to comment.