Sfoglia il codice sorgente

Add ability to restart

I restored the original line as it can be misleading.
ElMoribond 3 anni fa
parent
commit
f9add57ed4
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      web/src/api/mqtt.jsx

+ 1 - 1
web/src/api/mqtt.jsx

@@ -75,7 +75,7 @@ export function MqttProvider({
 export function useMqtt(watchTopic, publishTopic, defaultValue = null) {
 export function useMqtt(watchTopic, publishTopic, defaultValue = null) {
   const { state, ws } = useContext(Mqtt);
   const { state, ws } = useContext(Mqtt);
 
 
-  const value = state[watchTopic] || { payload: defaultValue };
+  const value = state[watchTopic] || { payload: null };
 
 
   const send = useCallback(
   const send = useCallback(
     (payload) => {
     (payload) => {