From ebb785397c4ad127ce2e206b7aca6de2a099731d Mon Sep 17 00:00:00 2001 From: Anthony Hinsinger Date: Fri, 26 Jun 2020 08:15:52 +0200 Subject: [PATCH] Fixed switch update according to switch rule --- src/components/indi/device.js | 19 ------------------- src/components/indi/switch.js | 11 +++++++++-- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/components/indi/device.js b/src/components/indi/device.js index 0d585b2..4837060 100644 --- a/src/components/indi/device.js +++ b/src/components/indi/device.js @@ -14,14 +14,6 @@ import { } from "grommet"; import { Close, Trash } from "grommet-icons"; -const CONNECT_DEVICE = gql` - mutation connectDevice($id: String!) { - connectDevice(id: $id) { - id - } - } -`; - const MSGS_FRAGMENT = gql` fragment DeviceMsgs on Device { messages @@ -30,9 +22,6 @@ const MSGS_FRAGMENT = gql` const Device = ({ device, messages, onMessagesClosed }) => { const client = useApolloClient(); - const [connect] = useMutation(CONNECT_DEVICE, { - variables: { id: device.id }, - }); const [groups, setGroups] = useState([]); const [selectedTabs, setSelectedTabs] = useState({}); const [currentTab, setCurrentTab] = useState(0); @@ -49,14 +38,6 @@ const Device = ({ device, messages, onMessagesClosed }) => { return ( - {!device.connected && ( -