diff --git a/nepalingo-web/src/pages/FlashcardPage.tsx b/nepalingo-web/src/pages/FlashcardPage.tsx index 8d12fd9..e1f4fe0 100644 --- a/nepalingo-web/src/pages/FlashcardPage.tsx +++ b/nepalingo-web/src/pages/FlashcardPage.tsx @@ -1,14 +1,23 @@ import Flashcard from "@/components/Flashcard"; import Header from "@/components/header/Header"; -import React from "react"; +import React, { useEffect } from "react"; +import { useStreak } from "@/hooks/StreakContext"; import ReactGA from "react-ga4"; const FlashcardPage: React.FC = () => { + const { updateStreak } = useStreak(); + ReactGA.send({ hitType: "pageview", page: window.location.pathname, title: "flashcard page", }); + + useEffect(() => { + updateStreak(); // Trigger streak update on flashcard page load + console.log("Updated Streak"); + }, []); + return ( <>