Fix posthog callsites

This commit is contained in:
Will Chen
2025-04-21 14:43:20 -07:00
parent 0e48d02a0b
commit 40132ec5da
4 changed files with 6 additions and 10 deletions

View File

@@ -18,7 +18,6 @@ import {
import { ChatList } from "./ChatList";
import { AppList } from "./AppList";
import { HelpDialog } from "./HelpDialog"; // Import the new dialog
import { usePostHog } from "posthog-js/react";
// Menu items.
const items = [
@@ -146,8 +145,6 @@ function AppIcons({
}: {
onHoverChange: (state: HoverState) => void;
}) {
const { capture } = usePostHog();
const routerState = useRouterState();
const pathname = routerState.location.pathname;

View File

@@ -38,7 +38,7 @@ import { useRunApp } from "@/hooks/useRunApp";
import { AutoApproveSwitch } from "../AutoApproveSwitch";
import { usePostHog } from "posthog-js/react";
export function ChatInput({ chatId }: { chatId?: number }) {
const { capture } = usePostHog();
const posthog = usePostHog();
const [inputValue, setInputValue] = useAtom(chatInputValueAtom);
const textareaRef = useRef<HTMLTextAreaElement>(null);
const { settings, updateSettings, isAnyProviderSetup } = useSettings();
@@ -105,7 +105,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
const currentInput = inputValue;
setInputValue("");
await streamMessage({ prompt: currentInput, chatId });
capture("chat:submit");
posthog.capture("chat:submit");
};
const handleCancel = () => {
@@ -126,7 +126,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
`Approving proposal for chatId: ${chatId}, messageId: ${messageId}`
);
setIsApproving(true);
capture("chat:approve");
posthog.capture("chat:approve");
try {
const result = await IpcClient.getInstance().approveProposal({
chatId,
@@ -160,7 +160,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
`Rejecting proposal for chatId: ${chatId}, messageId: ${messageId}`
);
setIsRejecting(true);
capture("chat:reject");
posthog.capture("chat:reject");
try {
const result = await IpcClient.getInstance().rejectProposal({
chatId,

View File

@@ -6,7 +6,6 @@ import { useSettings } from "@/hooks/useSettings";
import { homeChatInputValueAtom } from "@/atoms/chatAtoms"; // Use a different atom for home input
import { useAtom } from "jotai";
import { useStreamChat } from "@/hooks/useStreamChat";
import { usePostHog } from "posthog-js/react";
export function HomeChatInput({ onSubmit }: { onSubmit: () => void }) {
const [inputValue, setInputValue] = useAtom(homeChatInputValueAtom);