mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
Sockets - avoid sending invalid JSON when entering state with no socket
definition.
This commit is contained in:
@@ -135,7 +135,7 @@ export default
|
|||||||
// to the API: {"groups": {}}.
|
// to the API: {"groups": {}}.
|
||||||
// This is used for all pages that are socket-disabled
|
// This is used for all pages that are socket-disabled
|
||||||
if(this.requiresNewSubscribe(state)){
|
if(this.requiresNewSubscribe(state)){
|
||||||
this.emit(JSON.stringify(state.data.socket));
|
this.emit(JSON.stringify(state.data.socket) || JSON.stringify({"groups": {}}));
|
||||||
}
|
}
|
||||||
this.setLast(state);
|
this.setLast(state);
|
||||||
},
|
},
|
||||||
@@ -205,8 +205,8 @@ export default
|
|||||||
// requires a subscribe or an unsubscribe
|
// requires a subscribe or an unsubscribe
|
||||||
var self = this;
|
var self = this;
|
||||||
socketPromise.promise.then(function(){
|
socketPromise.promise.then(function(){
|
||||||
if(!state.data && !state.data.socket){
|
if(!state.data || !state.data.socket){
|
||||||
state.data.socket = {groups: {}};
|
_.merge(state.data, {socket: {groups: {}}});
|
||||||
self.unsubscribe(state);
|
self.unsubscribe(state);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
Reference in New Issue
Block a user