summaryrefslogtreecommitdiff
path: root/extension/react-app/src/tabs
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-06-18 18:55:14 -0700
committerNate Sesti <sestinj@gmail.com>2023-06-18 18:55:14 -0700
commitea8e812a9361a609c1d666bd518112196c6e64b0 (patch)
tree31c0cf26a37be5d2684870ee4c096d5e8ddef913 /extension/react-app/src/tabs
parentc3e498c1d14044222636a7a24c4eff37cb827dd5 (diff)
downloadsncontinue-ea8e812a9361a609c1d666bd518112196c6e64b0.tar.gz
sncontinue-ea8e812a9361a609c1d666bd518112196c6e64b0.tar.bz2
sncontinue-ea8e812a9361a609c1d666bd518112196c6e64b0.zip
posthog on data switch, fixed copy button
Diffstat (limited to 'extension/react-app/src/tabs')
-rw-r--r--extension/react-app/src/tabs/gui.tsx12
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"