mirror of https://github.com/BTCPrivate/copay.git
Fix Karma test
This commit is contained in:
parent
f704826a5c
commit
dbf812f848
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('SidebarController',
|
||||
function($scope, $rootScope, $sce, $location, $http, $idle, notification, controllerUtils) {
|
||||
function($scope, $rootScope, $sce, $location, $http, notification, controllerUtils) {
|
||||
|
||||
$scope.version = copay.version;
|
||||
$scope.networkName = config.networkName;
|
||||
|
@ -83,14 +83,11 @@ angular.module('copayApp.controllers').controller('SidebarController',
|
|||
controllerUtils.setSocketHandlers();
|
||||
|
||||
if ($rootScope.wallet) {
|
||||
$idle.watch();
|
||||
|
||||
$scope.$on('$idleStart', function(a) {
|
||||
notification.warning('Timing', 'You were enought time in inactivity. This session will be closed in 10 seconds if continues without activity');
|
||||
});
|
||||
|
||||
$scope.$on('$idleTimeout', function() {
|
||||
$idle.unwatch();
|
||||
$scope.signout();
|
||||
notification.warning('Session closed', 'Session closed for a long time of inactivity');
|
||||
});
|
||||
|
|
|
@ -73,12 +73,14 @@ angular
|
|||
$idleProvider.idleDuration(15 * 60); // in seconds
|
||||
$idleProvider.warningDuration(10); // in seconds
|
||||
})
|
||||
.run(function($rootScope, $location) {
|
||||
.run(function($rootScope, $location, $idle) {
|
||||
$idle.watch();
|
||||
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
||||
if (!util.supports.data) {
|
||||
$location.path('unsupported');
|
||||
} else {
|
||||
if ((!$rootScope.wallet || !$rootScope.wallet.id) && next.validate) {
|
||||
$idle.unwatch();
|
||||
$location.path('/');
|
||||
}
|
||||
if ($rootScope.wallet && !$rootScope.wallet.isReady()) {
|
||||
|
|
|
@ -21,6 +21,7 @@ module.exports = function(config) {
|
|||
'lib/angular/angular.min.js',
|
||||
'lib/angular-mocks/angular-mocks.js',
|
||||
'lib/moment/moment.js',
|
||||
'lib/ng-idle/angular-idle.min.js',
|
||||
'lib/angular-moment/angular-moment.js',
|
||||
'lib/qrcode-generator/js/qrcode.js',
|
||||
'lib/angular-qrcode/qrcode.js',
|
||||
|
|
Loading…
Reference in New Issue