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 = () => { dataSourcesChanged = () => {
this.socket.send( if (this.socket instanceof WebSocket) {
JSON.stringify({ this.socket?.send(
event: 'events', JSON.stringify({
data: { message: 'dataSourcesChanged', appId: this.state.appId }, event: 'events',
}) data: { message: 'dataSourcesChanged', appId: this.state.appId },
); })
);
} else {
this.fetchDataSources();
}
}; };
dataQueriesChanged = () => { dataQueriesChanged = () => {
this.setState({ addingQuery: false }, () => { this.setState({ addingQuery: false }, () => {
this.socket.send( if (this.socket instanceof WebSocket) {
JSON.stringify({ this.socket?.send(
event: 'events', JSON.stringify({
data: { message: 'dataQueriesChanged', appId: this.state.appId }, event: 'events',
}) data: { message: 'dataQueriesChanged', appId: this.state.appId },
); })
);
} else {
this.fetchDataQueries();
}
}); });
}; };