diff options
author | Anton Tananaev <anton@traccar.org> | 2022-04-17 11:51:27 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-04-17 11:51:27 -0700 |
commit | e470eeb4fcc923bc54968a6561f66c75dab288b9 (patch) | |
tree | fe17741ad65384e63d299426ae765b1e9fa3acfe /modern/src/DevicesList.js | |
parent | 2054cc9d11d77d7883a5858bcbcc3833aed4b874 (diff) | |
download | trackermap-web-e470eeb4fcc923bc54968a6561f66c75dab288b9.tar.gz trackermap-web-e470eeb4fcc923bc54968a6561f66c75dab288b9.tar.bz2 trackermap-web-e470eeb4fcc923bc54968a6561f66c75dab288b9.zip |
Remove selectors file
Diffstat (limited to 'modern/src/DevicesList.js')
-rw-r--r-- | modern/src/DevicesList.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modern/src/DevicesList.js b/modern/src/DevicesList.js index a2495f9d..0ea07319 100644 --- a/modern/src/DevicesList.js +++ b/modern/src/DevicesList.js @@ -18,7 +18,6 @@ import { devicesActions } from './store'; import EditCollectionView from './EditCollectionView'; import { useEffectAsync } from './reactHelper'; import { formatPosition, getBatteryStatus, getStatusColor } from './common/formatter'; -import { getDevices, getPosition } from './common/selectors'; import { useTranslation } from './LocalizationProvider'; const useStyles = makeStyles((theme) => ({ @@ -66,7 +65,7 @@ const DeviceRow = ({ data, index, style }) => { const { items } = data; const item = items[index]; - const position = useSelector(getPosition(item.id)); + const position = useSelector((state) => state.positions.items[item.id]); const showIgnition = position?.attributes.hasOwnProperty('ignition') && position.attributes.ignition; return ( @@ -109,7 +108,7 @@ const DeviceView = ({ updateTimestamp, onMenuClick, filter }) => { const dispatch = useDispatch(); const listInnerEl = useRef(null); - const items = useSelector(getDevices); + const items = useSelector((state) => Object.values(state.devices.items)); const [filteredItems, setFilteredItems] = useState(null); useEffect(() => { |