diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-18 18:55:14 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-18 18:55:14 -0700 |
commit | 8aa8e0b5c8402014b01f6ea6ce2e3d686f3c64b2 (patch) | |
tree | 4f8371270a7b72972f625fb1f8090f34da6c906d /extension/react-app/src/tabs/gui.tsx | |
parent | a39bec0dea93c83b5eef446543f991218ecc810c (diff) | |
download | sncontinue-8aa8e0b5c8402014b01f6ea6ce2e3d686f3c64b2.tar.gz sncontinue-8aa8e0b5c8402014b01f6ea6ce2e3d686f3c64b2.tar.bz2 sncontinue-8aa8e0b5c8402014b01f6ea6ce2e3d686f3c64b2.zip |
posthog on data switch, fixed copy button
Diffstat (limited to 'extension/react-app/src/tabs/gui.tsx')
-rw-r--r-- | extension/react-app/src/tabs/gui.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
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<string[]>([]); 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" |