Skip to content

Commit

Permalink
fix console custom functions bug (close #1561) (#1566)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikvt26 authored and rikinsk committed Feb 6, 2019
1 parent 39982d4 commit ad72984
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ class ModifyCustomFunction extends React.Component {
}
componentDidMount() {
const { functionName, schema } = this.props.params;
if (!functionName) {
if (!functionName || !schema) {
this.props.dispatch(push(prefixUrl));
}
Promise.all([
this.props.dispatch(fetchCustomFunction(functionName, schema)),
]);
}
componentWillReceiveProps(nextProps) {
const { functionName, schema } = this.props.params;
if (functionName !== nextProps.params.functionName || schema !== nextProps.params.schema) {
Promise.all([
this.props.dispatch(fetchCustomFunction(nextProps.params.functionName, nextProps.params.schema)),
]);
}
}
loadRunSQLAndLoadPage() {
const { functionDefinition } = this.props.functions;
Promise.all([
Expand Down

0 comments on commit ad72984

Please sign in to comment.