File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 56
56
switch ( rejection . status ) {
57
57
case 401 :
58
58
var deferred = $q . defer ( ) ;
59
- httpBuffer . append ( config , deferred ) ;
60
- $rootScope . $broadcast ( 'event:auth-loginRequired' , rejection ) ;
59
+ var bufferLength = httpBuffer . append ( config , deferred ) ;
60
+ if ( bufferLength === 1 )
61
+ $rootScope . $broadcast ( 'event:auth-loginRequired' , rejection ) ;
61
62
return deferred . promise ;
62
63
case 403 :
63
64
$rootScope . $broadcast ( 'event:auth-forbidden' , rejection ) ;
97
98
return {
98
99
/**
99
100
* Appends HTTP request configuration object with deferred response attached to buffer.
101
+ * @return {Number } The new length of the buffer.
100
102
*/
101
103
append : function ( config , deferred ) {
102
- buffer . push ( {
104
+ return buffer . push ( {
103
105
config : config ,
104
106
deferred : deferred
105
107
} ) ;
You can’t perform that action at this time.
0 commit comments