Fix posthog callsites
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user