Remove Timeout.
This commit is contained in:
parent
76eb9012fa
commit
620018c501
@ -3,8 +3,7 @@ import {CartesianGrid, Legend, Line, LineChart, ResponsiveContainer, Tooltip, XA
|
|||||||
import SensorCardDeck from './SensorCardDeck'
|
import SensorCardDeck from './SensorCardDeck'
|
||||||
import {SensorDataCollection, ActiveDeviceCollection} from "../../client/main";
|
import {SensorDataCollection, ActiveDeviceCollection} from "../../client/main";
|
||||||
import {useTracker} from 'meteor/react-meteor-data';
|
import {useTracker} from 'meteor/react-meteor-data';
|
||||||
|
import {Col, Form, Row, Card, CardDeck} from "react-bootstrap";
|
||||||
import {Col, Form, Row} from "react-bootstrap";
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
|
|
||||||
@ -19,10 +18,14 @@ export default function Home() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const sensorData = useTracker(() => {
|
const sensorData = useTracker(() => {
|
||||||
return SensorDataCollection.find({device_id: deviceName.deviceName}, {
|
if (deviceName === null || deviceName === undefined) {
|
||||||
sort: {timestamp: -1},
|
return [];
|
||||||
limit: 61
|
} else {
|
||||||
}).fetch().reverse();
|
return SensorDataCollection.find({device_id: deviceName.deviceName}, {
|
||||||
|
sort: {timestamp: -1},
|
||||||
|
limit: 61
|
||||||
|
}).fetch().reverse();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleChange = (e) => {
|
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 (
|
return (
|
||||||
<CardDeck>
|
<CardDeck>
|
||||||
<Card>
|
<Card>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user