aboutsummaryrefslogtreecommitdiff
path: root/modern/src/DeviceList.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-03-22 17:32:36 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-03-22 17:32:36 -0700
commit00daddce89f70989baecd8725e6df9bc88257b53 (patch)
treeabe4d199f269bb925831421fab17f5141f2640c3 /modern/src/DeviceList.js
parent5e98816922c284805714e35a678f1a7dfa3facb8 (diff)
downloadetbsa-traccar-web-00daddce89f70989baecd8725e6df9bc88257b53.tar.gz
etbsa-traccar-web-00daddce89f70989baecd8725e6df9bc88257b53.tar.bz2
etbsa-traccar-web-00daddce89f70989baecd8725e6df9bc88257b53.zip
Display features
Diffstat (limited to 'modern/src/DeviceList.js')
-rw-r--r--modern/src/DeviceList.js13
1 files changed, 1 insertions, 12 deletions
diff --git a/modern/src/DeviceList.js b/modern/src/DeviceList.js
index c500242..f636921 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()}>