Skip to content

Commit e1b5f63

Browse files
author
Andy Buecker
committed
fix(protractor): Replace $timeout with $interval
1 parent 5955852 commit e1b5f63

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/scripts/services/access-token.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var accessTokenService = angular.module('oauth.accessToken', ['ngStorage']);
44

5-
accessTokenService.factory('AccessToken', function($rootScope, $location, $sessionStorage, $timeout){
5+
accessTokenService.factory('AccessToken', function($rootScope, $location, $sessionStorage, $interval){
66

77
var service = {
88
token: null
@@ -144,9 +144,9 @@ accessTokenService.factory('AccessToken', function($rootScope, $location, $sessi
144144
var setExpiresAtEvent = function(){
145145
var time = (new Date(service.token.expires_at))-(new Date());
146146
if(time){
147-
$timeout(function(){
147+
$interval(function(){
148148
$rootScope.$broadcast('oauth:expired', service.token)
149-
}, time)
149+
}, time, 1)
150150
}
151151
};
152152

dist/oauth-ng.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ angular.module('oauth').config(['$locationProvider','$httpProvider',
2020

2121
var accessTokenService = angular.module('oauth.accessToken', ['ngStorage']);
2222

23-
accessTokenService.factory('AccessToken', function($rootScope, $location, $sessionStorage, $timeout){
23+
accessTokenService.factory('AccessToken', function($rootScope, $location, $sessionStorage, $interval){
2424

2525
var service = {
2626
token: null
@@ -162,9 +162,9 @@ accessTokenService.factory('AccessToken', function($rootScope, $location, $sessi
162162
var setExpiresAtEvent = function(){
163163
var time = (new Date(service.token.expires_at))-(new Date());
164164
if(time){
165-
$timeout(function(){
165+
$interval(function(){
166166
$rootScope.$broadcast('oauth:expired', service.token)
167-
}, time)
167+
}, time, 1)
168168
}
169169
};
170170

0 commit comments

Comments
 (0)