refactor lock warning and add tests
This commit is contained in:
parent
fb3a7191e5
commit
35ab711846
13 changed files with 632 additions and 557 deletions
28
js/controllers/warning.js
Normal file
28
js/controllers/warning.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.controllers').controller('WarningController', function($scope, $rootScope, $location, controllerUtils) {
|
||||
|
||||
|
||||
$scope.checkLock = function() {
|
||||
if (!$rootScope.tmp || !$rootScope.tmp.getLock()) {
|
||||
controllerUtils.redirIfLogged();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$scope.signout = function() {
|
||||
controllerUtils.logout();
|
||||
};
|
||||
|
||||
$scope.ignoreLock = function() {
|
||||
var w = $rootScope.tmp;
|
||||
delete $rootScope['tmp'];
|
||||
|
||||
if (!w) {
|
||||
$location.path('/');
|
||||
} else {
|
||||
w.ignoreLock = 1;
|
||||
$scope.loading = true;
|
||||
controllerUtils.startNetwork(w, $scope);
|
||||
}
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue