diff --git a/app/components/App.tsx b/app/components/App.tsx
index f689c28..33aa862 100644
--- a/app/components/App.tsx
+++ b/app/components/App.tsx
@@ -1,7 +1,7 @@
import { observer } from "mobx-react";
// import DevTools from "mobx-react-devtools";
import * as React from "react";
-import { Redirect, Route, Switch } from "react-router";
+import { Redirect, Route, RouteComponentProps, Switch } from "react-router";
import { BrowserRouter as Router } from "react-router-dom";
import { Container } from "semantic-ui-react";
@@ -12,9 +12,9 @@ import "font-awesome/css/font-awesome.css";
import "semantic-ui-css/semantic.css";
import "@app/styles/app.scss";
-function DevicePage() {
+function DevicePage({match}: RouteComponentProps<{deviceId: string}>) {
return (
-
+
);
}
@@ -32,7 +32,7 @@ class App extends React.Component {
-
+
diff --git a/app/components/DevicesView.tsx b/app/components/DevicesView.tsx
index 2960172..f718103 100644
--- a/app/components/DevicesView.tsx
+++ b/app/components/DevicesView.tsx
@@ -4,11 +4,11 @@ import { Item } from "semantic-ui-react";
import DeviceView from "@app/components/DeviceView";
-class DevicesView extends React.Component {
+class DevicesView extends React.Component<{deviceId: string}> {
render() {
return (
-
+
);
}
diff --git a/common/sprinklers/mqtt/index.ts b/common/sprinklers/mqtt/index.ts
index 98ce8ea..75d2026 100644
--- a/common/sprinklers/mqtt/index.ts
+++ b/common/sprinklers/mqtt/index.ts
@@ -147,6 +147,9 @@ class MqttSprinklersDevice extends s.SprinklersDevice {
const brokerConnected = apiClient.connected;
this.connectionState.serverToBroker = brokerConnected;
if (brokerConnected) {
+ if (this.connectionState.brokerToDevice == null) {
+ this.connectionState.brokerToDevice = false;
+ }
this.doSubscribe();
} else {
this.connectionState.brokerToDevice = false;