code refactor
This commit is contained in:
parent
ff5b662f39
commit
709b0369f1
3 changed files with 1 additions and 10 deletions
|
|
@ -122,7 +122,6 @@ angular.module('copayApp.controllers').controller('pinController', function($sta
|
||||||
break;
|
break;
|
||||||
case 'check':
|
case 'check':
|
||||||
if (isMatch(currentPin)) {
|
if (isMatch(currentPin)) {
|
||||||
applicationService.successfullUnlocked = true;
|
|
||||||
$scope.hideModal();
|
$scope.hideModal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1231,6 +1231,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
// Clear history
|
// Clear history
|
||||||
$ionicHistory.clearHistory();
|
$ionicHistory.clearHistory();
|
||||||
});
|
});
|
||||||
|
applicationService.appLockModal('check');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// After everything have been loaded, initialize handler URL
|
// After everything have been loaded, initialize handler URL
|
||||||
|
|
@ -1258,7 +1259,5 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
$log.debug('Route change from:', fromState.name || '-', ' to:', toState.name);
|
$log.debug('Route change from:', fromState.name || '-', ' to:', toState.name);
|
||||||
$log.debug(' toParams:' + JSON.stringify(toParams || {}));
|
$log.debug(' toParams:' + JSON.stringify(toParams || {}));
|
||||||
$log.debug(' fromParams:' + JSON.stringify(fromParams || {}));
|
$log.debug(' fromParams:' + JSON.stringify(fromParams || {}));
|
||||||
|
|
||||||
if (!applicationService.successfullUnlocked) applicationService.appLockModal('check');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,6 @@ angular.module('copayApp.services')
|
||||||
.factory('applicationService', function($rootScope, $timeout, $ionicHistory, $ionicModal, platformInfo, fingerprintService, openURLService, configService, $state) {
|
.factory('applicationService', function($rootScope, $timeout, $ionicHistory, $ionicModal, platformInfo, fingerprintService, openURLService, configService, $state) {
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
root.successfullUnlocked = false;
|
|
||||||
root.pinModalIsOpen = false;
|
|
||||||
|
|
||||||
var isChromeApp = platformInfo.isChromeApp;
|
var isChromeApp = platformInfo.isChromeApp;
|
||||||
var isNW = platformInfo.isNW;
|
var isNW = platformInfo.isNW;
|
||||||
|
|
||||||
|
|
@ -42,12 +39,10 @@ angular.module('copayApp.services')
|
||||||
root.fingerprintModal();
|
root.fingerprintModal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
root.successfullUnlocked = true;
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.pinModal = function(action) {
|
root.pinModal = function(action) {
|
||||||
if (root.pinModalIsOpen) return;
|
|
||||||
|
|
||||||
var scope = $rootScope.$new(true);
|
var scope = $rootScope.$new(true);
|
||||||
scope.action = action;
|
scope.action = action;
|
||||||
|
|
@ -61,12 +56,10 @@ angular.module('copayApp.services')
|
||||||
scope.openModal();
|
scope.openModal();
|
||||||
});
|
});
|
||||||
scope.openModal = function() {
|
scope.openModal = function() {
|
||||||
root.pinModalIsOpen = true;
|
|
||||||
scope.pinModal.show();
|
scope.pinModal.show();
|
||||||
};
|
};
|
||||||
scope.hideModal = function() {
|
scope.hideModal = function() {
|
||||||
scope.$emit('pinModalClosed');
|
scope.$emit('pinModalClosed');
|
||||||
root.pinModalIsOpen = false;
|
|
||||||
scope.pinModal.hide();
|
scope.pinModal.hide();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue