From 620018c501f4679a0733454058c043d03d7c45ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Uribe=20Stengel?= Date: Thu, 16 Jul 2020 15:19:01 +0200 Subject: [PATCH] Remove Timeout. --- imports/ui/Home.jsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/imports/ui/Home.jsx b/imports/ui/Home.jsx index 9d63f78..e57d60e 100644 --- a/imports/ui/Home.jsx +++ b/imports/ui/Home.jsx @@ -3,8 +3,7 @@ import {CartesianGrid, Legend, Line, LineChart, ResponsiveContainer, Tooltip, XA import SensorCardDeck from './SensorCardDeck' import {SensorDataCollection, ActiveDeviceCollection} from "../../client/main"; import {useTracker} from 'meteor/react-meteor-data'; - -import {Col, Form, Row} from "react-bootstrap"; +import {Col, Form, Row, Card, CardDeck} from "react-bootstrap"; export default function Home() { @@ -19,10 +18,14 @@ export default function Home() { }); const sensorData = useTracker(() => { - return SensorDataCollection.find({device_id: deviceName.deviceName}, { - sort: {timestamp: -1}, - limit: 61 - }).fetch().reverse(); + if (deviceName === null || deviceName === undefined) { + return []; + } else { + return SensorDataCollection.find({device_id: deviceName.deviceName}, { + sort: {timestamp: -1}, + limit: 61 + }).fetch().reverse(); + } }); const handleChange = (e) => { @@ -35,7 +38,7 @@ export default function Home() { } - if ((sensorData.length <= 0) || (deviceName.length <= 0) || (uniqueEspNames.length <= 0)) { + if ((sensorData.length <= 0) || (deviceName.length <= 0)) { return (