diff --git a/smart-hut/src/components/SceneModal.js b/smart-hut/src/components/SceneModal.js index 513c2e6..8b935cc 100644 --- a/smart-hut/src/components/SceneModal.js +++ b/smart-hut/src/components/SceneModal.js @@ -9,6 +9,7 @@ import { Input, Dropdown, Checkbox, + Segment, } from "semantic-ui-react"; import SelectIcons from "./SelectIcons"; import { connect } from "react-redux"; @@ -110,15 +111,15 @@ class SceneModal extends Component { }; closeModal = (e) => { - this.setState({ openModal: false }); + this.setState({ ...this.state, openModal: false }); }; openModal = (e) => { - this.setState({ openModal: true }); + this.setState({ ...this.state, openModal: true }); }; updateIcon(e) { - this.setState({ selectedIcon: e }); + this.setState({ ...this.state, selectedIcon: e }); } setCopyFrom(_, copyFrom) { @@ -127,7 +128,7 @@ class SceneModal extends Component { setGuestAccessEnabled(val) { console.log(this.state, val); - this.setState({ guestAccessEnabled: val }); + this.setState({ ...this.state, guestAccessEnabled: val }); } render() { @@ -223,13 +224,16 @@ class SceneModal extends Component { )} {this.type === "modify" ? ( + this.setGuestAccessEnabled(val.checked) } /> + ) : null}