From d219716526512133a1431a1f88ba5d9efd97962f Mon Sep 17 00:00:00 2001 From: britea Date: Fri, 17 Apr 2020 14:30:34 +0200 Subject: [PATCH] Fix data on adding room --- smart-hut/src/components/RoomModal.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/smart-hut/src/components/RoomModal.js b/smart-hut/src/components/RoomModal.js index 36496b2..08f75d2 100644 --- a/smart-hut/src/components/RoomModal.js +++ b/smart-hut/src/components/RoomModal.js @@ -49,19 +49,11 @@ class RoomModal extends Component { } setInitialState() { - for (let key in this.initialState) { - if (this.initialState.hasOwnProperty(key)) { - //console.log(key + " -> " + this.initialState[key]); - this.setState({ - key: this.initialState[key], - }); - } - } - console.log(this.initialState); - //this.setState(state); + this.setState(this.initialState); } get type() { + console.log(this.props.id); return !this.props.id ? "new" : "modify"; }