diff --git a/web/src/app/api/integrations/calendar/events/route.ts b/web/src/app/api/integrations/calendar/events/route.ts index 19feb6f..3f72b5f 100644 --- a/web/src/app/api/integrations/calendar/events/route.ts +++ b/web/src/app/api/integrations/calendar/events/route.ts @@ -3,7 +3,6 @@ import { fetchCalendarEvents } from "@/lib/integrations/calendar"; export async function GET() { try { - // In a real app, we would get the user ID from the session const events = await fetchCalendarEvents(); return NextResponse.json(events); } catch (error) { diff --git a/web/src/components/Onboarding.tsx b/web/src/components/Onboarding.tsx index 444d30f..6a937f7 100644 --- a/web/src/components/Onboarding.tsx +++ b/web/src/components/Onboarding.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState } from "react"; +import { useState, useEffect } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { Card, CardContent, CardHeader, CardTitle, CardFooter } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; @@ -17,6 +17,8 @@ interface Step { icon: React.ReactNode; } +const ONBOARDING_SEEN_KEY = "devcontext:onboarding-seen"; + const steps: Step[] = [ { title: "Welcome to DevContext!", @@ -41,14 +43,15 @@ const steps: Step[] = [ ]; export function Onboarding() { - const [isOpen, setIsOpen] = useState(() => { - if (typeof window !== 'undefined') { - return !localStorage.getItem("devcontext:onboarding-seen"); - } - return false; - }); + const [isOpen, setIsOpen] = useState(false); const [currentStep, setCurrentStep] = useState(0); + useEffect(() => { + if (!localStorage.getItem(ONBOARDING_SEEN_KEY)) { + setIsOpen(true); + } + }, []); + const handleNext = () => { if (currentStep < steps.length - 1) { setCurrentStep(currentStep + 1); @@ -58,7 +61,7 @@ export function Onboarding() { }; const handleComplete = () => { - localStorage.setItem("devcontext:onboarding-seen", "true"); + localStorage.setItem(ONBOARDING_SEEN_KEY, "true"); setIsOpen(false); }; diff --git a/web/src/lib/analytics/dna.ts b/web/src/lib/analytics/dna.ts index 1ffc3aa..275854c 100644 --- a/web/src/lib/analytics/dna.ts +++ b/web/src/lib/analytics/dna.ts @@ -43,7 +43,6 @@ export async function calculateCodeDNA(user: string): Promise { const ts = a.timestamp.getTime(); if (ts - lastTimestamp > 30 * 60 * 1000) { if (currentSessionFiles.size > 0) filesPerSession.push(currentSessionFiles.size); - sessions++; currentSessionFiles = new Set(); } currentSessionFiles.add(a.target);