From ea8e812a9361a609c1d666bd518112196c6e64b0 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sun, 18 Jun 2023 18:55:14 -0700 Subject: posthog on data switch, fixed copy button --- extension/react-app/src/tabs/gui.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'extension/react-app/src/tabs') diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx index 52318dca..eee2b1a0 100644 --- a/extension/react-app/src/tabs/gui.tsx +++ b/extension/react-app/src/tabs/gui.tsx @@ -15,6 +15,9 @@ import ComboBox from "../components/ComboBox"; import TextDialog from "../components/TextDialog"; import HeaderButtonWithText from "../components/HeaderButtonWithText"; import ReactSwitch from "react-switch"; +import { usePostHog } from "posthog-js/react"; +import { useSelector } from "react-redux"; +import { RootStore } from "../redux/store"; const TopGUIDiv = styled.div` overflow: hidden; @@ -46,6 +49,11 @@ interface GUIProps { } function GUI(props: GUIProps) { + const posthog = usePostHog(); + const vscMachineId = useSelector( + (state: RootStore) => state.config.vscMachineId + ); + const [waitingForSteps, setWaitingForSteps] = useState(false); const [userInputQueue, setUserInputQueue] = useState([]); const [availableSlashCommands, setAvailableSlashCommands] = useState< @@ -432,6 +440,10 @@ function GUI(props: GUIProps) { handleDiameter={20} width={40} onChange={() => { + posthog?.capture("data_switch_toggled", { + vscMachineId: vscMachineId, + dataSwitchChecked: !dataSwitchChecked, + }); setDataSwitchChecked((prev) => !prev); }} onColor="#12887a" -- cgit v1.2.3-70-g09d2