diff --git a/interface/src/containers/NTPSettings.js b/interface/src/containers/NTPSettings.js index 54af15a..2e291a9 100644 --- a/interface/src/containers/NTPSettings.js +++ b/interface/src/containers/NTPSettings.js @@ -4,8 +4,6 @@ import { NTP_SETTINGS_ENDPOINT } from '../constants/Endpoints'; import {restComponent} from '../components/RestComponent'; import SectionContent from '../components/SectionContent'; import NTPSettingsForm from '../forms/NTPSettingsForm'; -import { simpleGet } from '../helpers/SimpleGet'; -import { simplePost } from '../helpers/SimplePost'; class NTPSettings extends Component { diff --git a/interface/src/containers/OTASettings.js b/interface/src/containers/OTASettings.js index ebc1cc8..95be458 100644 --- a/interface/src/containers/OTASettings.js +++ b/interface/src/containers/OTASettings.js @@ -4,8 +4,6 @@ import { OTA_SETTINGS_ENDPOINT } from '../constants/Endpoints'; import {restComponent} from '../components/RestComponent'; import SectionContent from '../components/SectionContent'; import OTASettingsForm from '../forms/OTASettingsForm'; -import { simpleGet } from '../helpers/SimpleGet'; -import { simplePost } from '../helpers/SimplePost'; class OTASettings extends Component { diff --git a/interface/src/containers/WiFiSettings.js b/interface/src/containers/WiFiSettings.js index d561119..17f913c 100644 --- a/interface/src/containers/WiFiSettings.js +++ b/interface/src/containers/WiFiSettings.js @@ -5,24 +5,18 @@ import { WIFI_SETTINGS_ENDPOINT } from '../constants/Endpoints'; import { restComponent } from '../components/RestComponent'; import SectionContent from '../components/SectionContent'; import WiFiSettingsForm from '../forms/WiFiSettingsForm'; -import { simpleGet } from '../helpers/SimpleGet'; -import { simplePost } from '../helpers/SimplePost'; class WiFiSettings extends Component { constructor(props) { super(props); - this.state = { - selectedNetwork: null, - }; this.deselectNetworkAndLoadData = this.deselectNetworkAndLoadData.bind(this); - this.deselectNetwork = this.deselectNetwork.bind(this); } componentDidMount() { - const { selectedNetwork, deselectNetwork } = this.props; - if (selectedNetwork){ + const { selectedNetwork } = this.props; + if (selectedNetwork) { var wifiSettings = { ssid:selectedNetwork.ssid, password:"", @@ -30,25 +24,18 @@ class WiFiSettings extends Component { static_ip_config:false, } this.props.setData(wifiSettings); - this.setState({ selectedNetwork }); - deselectNetwork(); - }else { + } else { this.props.loadData(); } } deselectNetworkAndLoadData() { - this.deselectNetwork(); + this.props.deselectNetwork(); this.props.loadData(); } - deselectNetwork() { - this.setState({ selectedNetwork:null }); - } - render() { - const { selectedNetwork } = this.state; - const { data, fetched, errorMessage } = this.props; + const { data, fetched, errorMessage, selectedNetwork } = this.props; return ( + , - + , - + , - + , - + - ] + }