From 78755b2eab3f9b7a457eac53f39720d443caf2ac Mon Sep 17 00:00:00 2001 From: Karthik Venkateswaran Date: Wed, 6 Feb 2019 11:49:09 +0530 Subject: [PATCH] Fix and close #1561 --- .../Data/Function/Modify/ModifyCustomFunction.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/console/src/components/Services/Data/Function/Modify/ModifyCustomFunction.js b/console/src/components/Services/Data/Function/Modify/ModifyCustomFunction.js index 6a071106ecbdb..99cc491822b38 100644 --- a/console/src/components/Services/Data/Function/Modify/ModifyCustomFunction.js +++ b/console/src/components/Services/Data/Function/Modify/ModifyCustomFunction.js @@ -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([