xy 7 жил өмнө
parent
commit
32df085795

+ 2 - 2
src/components/common/schema/Schema.jsx

@@ -11,7 +11,7 @@ class Schema extends Component {
     constructor(props) {
         super(props);
         this.state = {
-            currentTable: props.location.state.create ? 'add' : '',
+            currentTable: props.location.state === undefined? '' : props.location.state.create ? 'add' : '',
             // default schemaID and schemaName
             schemaID: props.schemaID || props.location.state.schemaID,
             schemaName: props.schemaName || props.location.state.schemaName,
@@ -37,7 +37,7 @@ class Schema extends Component {
 
     componentWillReceiveProps(next) {
         this.setState({
-            currentTable: next.location.state.create ? 'add' : '',
+            currentTable: next.location.state === undefined? '' : next.location.state.create ? 'add' : '',
             schemaID: next.schemaID,
             schemaName: next.schemaName
         });