mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
-Refactored socket state to use growl.
This commit is contained in:
parent
9765a5759e
commit
dd38b478de
10 changed files with 95 additions and 70 deletions
|
@ -24,53 +24,5 @@ module.exports = function SocketFactory($rootScope) {
|
|||
}
|
||||
}
|
||||
|
||||
socket.on('connect', function() {
|
||||
$rootScope.$apply(function() {
|
||||
socket.state = 'connect'
|
||||
})
|
||||
})
|
||||
|
||||
socket.on('connecting', function() {
|
||||
$rootScope.$apply(function() {
|
||||
socket.state = 'connecting'
|
||||
})
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
$rootScope.$apply(function() {
|
||||
socket.state = 'disconnect'
|
||||
})
|
||||
})
|
||||
|
||||
socket.on('connect_failed', function() {
|
||||
$rootScope.$apply(function() {
|
||||
socket.state = 'connect_failed'
|
||||
})
|
||||
})
|
||||
|
||||
socket.on('error', function() {
|
||||
$rootScope.$apply(function() {
|
||||
socket.state = 'error'
|
||||
})
|
||||
})
|
||||
|
||||
socket.on('reconnect_failed', function() {
|
||||
$rootScope.$apply(function() {
|
||||
socket.state = 'reconnect_failed'
|
||||
})
|
||||
})
|
||||
|
||||
socket.on('reconnect', function() {
|
||||
$rootScope.$apply(function() {
|
||||
socket.state = 'reconnect'
|
||||
})
|
||||
})
|
||||
|
||||
socket.on('reconnecting', function() {
|
||||
$rootScope.$apply(function() {
|
||||
socket.state = 'reconnecting'
|
||||
})
|
||||
})
|
||||
|
||||
return socket
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue