diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-03-22 17:32:36 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-03-22 17:32:36 -0700 |
commit | 00daddce89f70989baecd8725e6df9bc88257b53 (patch) | |
tree | abe4d199f269bb925831421fab17f5141f2640c3 /modern/src/DeviceList.js | |
parent | 5e98816922c284805714e35a678f1a7dfa3facb8 (diff) | |
download | trackermap-web-00daddce89f70989baecd8725e6df9bc88257b53.tar.gz trackermap-web-00daddce89f70989baecd8725e6df9bc88257b53.tar.bz2 trackermap-web-00daddce89f70989baecd8725e6df9bc88257b53.zip |
Display features
Diffstat (limited to 'modern/src/DeviceList.js')
-rw-r--r-- | modern/src/DeviceList.js | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/modern/src/DeviceList.js b/modern/src/DeviceList.js index c500242f..f636921d 100644 --- a/modern/src/DeviceList.js +++ b/modern/src/DeviceList.js @@ -1,6 +1,5 @@ import React, { Component, Fragment } from 'react'; import { connect } from 'react-redux'; -import { updateDevices } from './actions'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemAvatar from '@material-ui/core/ListItemAvatar'; @@ -13,20 +12,10 @@ import MoreVertIcon from '@material-ui/icons/MoreVert'; import Divider from '@material-ui/core/Divider'; const mapStateToProps = state => ({ - devices: state.devices + devices: Array.from(state.devices.values()) }); class DeviceList extends Component { - componentDidMount() { - fetch('/api/devices').then(response => { - if (response.ok) { - response.json().then(devices => { - this.props.dispatch(updateDevices(devices)); - }); - } - }); - } - render() { const devices = this.props.devices.map((device, index, list) => <Fragment key={device.id.toString()}> |