Fixes new added/deleted query doesnt update on query manager (#3001)

This commit is contained in:
Gandharv 2022-05-07 13:31:36 +05:30 committed by GitHub
parent 3ffa765ae3
commit 4f5b5ea6b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -393,22 +393,30 @@ class Editor extends React.Component {
};
dataSourcesChanged = () => {
this.socket.send(
JSON.stringify({
event: 'events',
data: { message: 'dataSourcesChanged', appId: this.state.appId },
})
);
if (this.socket instanceof WebSocket) {
this.socket?.send(
JSON.stringify({
event: 'events',
data: { message: 'dataSourcesChanged', appId: this.state.appId },
})
);
} else {
this.fetchDataSources();
}
};
dataQueriesChanged = () => {
this.setState({ addingQuery: false }, () => {
this.socket.send(
JSON.stringify({
event: 'events',
data: { message: 'dataQueriesChanged', appId: this.state.appId },
})
);
if (this.socket instanceof WebSocket) {
this.socket?.send(
JSON.stringify({
event: 'events',
data: { message: 'dataQueriesChanged', appId: this.state.appId },
})
);
} else {
this.fetchDataQueries();
}
});
};