diff --git a/index.html b/index.html index ad80194c2..9c4235557 100644 --- a/index.html +++ b/index.html @@ -38,6 +38,11 @@ +
+ +

Your session is about to expire due to inactivity in {{countdown}} seconds

+
+
diff --git a/js/controllers/head.js b/js/controllers/head.js index 559ddf422..33c296d79 100644 --- a/js/controllers/head.js +++ b/js/controllers/head.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('HeadController', function($scope, $rootScope, $filter, notification, controllerUtils) { +angular.module('copayApp.controllers').controller('HeadController', function($scope, $rootScope, $filter, $timeout, notification, controllerUtils) { $scope.username = $rootScope.iden.getName(); $scope.hoverMenu = false; @@ -42,12 +42,19 @@ angular.module('copayApp.controllers').controller('HeadController', function($sc }); if ($rootScope.wallet) { - $scope.$on('$idleWarn', function(a, countdown) { - if (!(countdown % 5)) - notification.warning('Session will be closed', $filter('translate')('Your session is about to expire due to inactivity in') + ' ' + countdown + ' ' + $filter('translate')('seconds')); + $scope.$on('$idleStart', function() { + }); + $scope.$on('$idleWarn', function(a, countdown) { + $rootScope.countdown = countdown; + $rootScope.sessionExpired = true; + }); + $scope.$on('$idleEnd', function() { + $timeout(function() { + $rootScope.sessionExpired = null; + }, 500); }); - $scope.$on('$idleTimeout', function() { + $rootScope.sessionExpired = null; $scope.signout(); notification.warning('Session closed', 'Session closed because a long time of inactivity'); }); diff --git a/views/home.html b/views/home.html index 26b501175..6f52f4741 100644 --- a/views/home.html +++ b/views/home.html @@ -1,11 +1,5 @@
- -