Skip to content

Commit

Permalink
Hotfix: Fix streak not updating
Browse files Browse the repository at this point in the history
This piece of code was lost during a git merge
  • Loading branch information
binamkayastha committed Jul 21, 2024
1 parent 970251e commit 2fa77fb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nepalingo-web/src/pages/FlashcardPage.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
<Header />
Expand Down

0 comments on commit 2fa77fb

Please sign in to comment.