fixed edit name on devices

This commit is contained in:
britea 2020-04-21 16:18:05 +02:00
parent 77f7abed92
commit 3b67e57f1a

View file

@ -1,5 +1,5 @@
import React, { Component, useState } from "react";
import { Button, Form, Icon, Header, Modal } from "semantic-ui-react";
import { Button, Form, Icon, Header, Modal, Input } from "semantic-ui-react";
import { connect } from "react-redux";
import { RemoteService } from "../../../remote";
@ -37,12 +37,11 @@ const SettingsForm = (props) => {
<Form>
<Form.Field>
<label>Edit Name: </label>
<input
<Input
autoComplete="off"
name="name"
onChange={handleInputChange}
value={props.name}
placeholder="Device name"
placeholder={props.name}
// {this.props.device.name}
/>
</Form.Field>
@ -85,7 +84,7 @@ class DeviceSettingsModal extends Component {
if (values.name.length === 0) return;
this.props
.saveDevice({ ...this.props.device, name: values.name })
.then(() => this.setState({ open: false }))
.then(() => this.setState({ openModal: false }))
.catch((err) =>
console.error(
`settings modal for device ${this.props.id} deletion error`,