xy 7 năm trước cách đây
mục cha
commit
32df085795
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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
         });