xy преди 7 години
родител
ревизия
32df085795
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      src/components/common/schema/Schema.jsx

+ 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
         });