From 95602704d53bb72d96d4947869bce63830888d52 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 4 Jun 2026 18:34:18 -0700 Subject: overhaul how daily is updated from server to client --- src/pages/DailyPage.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pages') diff --git a/src/pages/DailyPage.tsx b/src/pages/DailyPage.tsx index 5033366..24ac20c 100644 --- a/src/pages/DailyPage.tsx +++ b/src/pages/DailyPage.tsx @@ -1,8 +1,7 @@ import React from "react"; -import { Song } from "../types/song"; import { GuessType } from "../types/guess"; -import { getDailySolution } from "../helpers/fetchSolution"; +import { DailySolution, getDailySolution } from "../helpers/fetchSolution"; import { useGameState } from "../hooks/useGameState"; import { Header, InfoPopUp, Game, Footer } from "../components"; @@ -10,7 +9,7 @@ import { Header, InfoPopUp, Game, Footer } from "../components"; import * as Styled from "../app.styled"; export function DailyPage() { - const [todaysSolution, setTodaysSolution] = React.useState(null); + const [todaysSolution, setTodaysSolution] = React.useState(null); const firstRun = localStorage.getItem("firstRun") === null; @@ -70,7 +69,7 @@ export function DailyPage() { didGuess, skip, guess, - } = useGameState({ solution: todaysSolution, persist: true }); + } = useGameState({ solution: todaysSolution?.song ?? null, persist: true }); const [isInfoPopUpOpen, setIsInfoPopUpOpen] = React.useState(firstRun); @@ -98,7 +97,8 @@ export function DailyPage() {