mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
checking socket.readyState before emitting socket message
This commit is contained in:
parent
7ccedfb1df
commit
325e7f3cce
@ -191,14 +191,17 @@ export default
|
||||
var self = this;
|
||||
$log.debug('Sent to Websocket Server: ' + data);
|
||||
socketPromise.promise.then(function(){
|
||||
self.socket.send(data, function () {
|
||||
var args = arguments;
|
||||
self.scope.$apply(function () {
|
||||
if (callback) {
|
||||
callback.apply(self.socket, args);
|
||||
}
|
||||
console.log("socket readyState: " + self.socket.readyState);
|
||||
if(self.socket.readyState === 1){
|
||||
self.socket.send(data, function () {
|
||||
var args = arguments;
|
||||
self.scope.$apply(function () {
|
||||
if (callback) {
|
||||
callback.apply(self.socket, args);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addStateResolve: function(state, id){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user