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

@@ -24,7 +24,7 @@ export default function HomePage() {
const setIsPreviewOpen = useSetAtom(isPreviewOpenAtom);
const [isLoading, setIsLoading] = useState(false);
const { streamMessage } = useStreamChat({ hasChatId: false });
const { capture } = usePostHog();
const posthog = usePostHog();
// Get the appId from search params
const appId = search.appId ? Number(search.appId) : null;
@@ -53,7 +53,7 @@ export default function HomePage() {
setSelectedAppId(result.app.id);
setIsPreviewOpen(false);
await refreshApps(); // Ensure refreshApps is awaited if it's async
capture("home:chat-submit");
posthog.capture("home:chat-submit");
navigate({ to: "/chat", search: { id: result.chatId } });
} catch (error) {
console.error("Failed to create chat:", error);