diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-06-03 19:29:09 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-06-03 19:29:09 -0700 |
| commit | 8f187a4faf4b413e18a13e628c126f2e48ac6823 (patch) | |
| tree | 628ea36dea2802c8499b61de550b6df85902c6d7 /src | |
| parent | 470adff2f38e66411255977c9d467abbf2098e9c (diff) | |
remove /info move startDate back to client side
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/Player/index.tsx | 2 | ||||
| -rw-r--r-- | src/helpers/fetchInfo.ts | 9 | ||||
| -rw-r--r-- | src/helpers/scoreToEmoji.ts | 4 |
3 files changed, 2 insertions, 13 deletions
diff --git a/src/components/Player/index.tsx b/src/components/Player/index.tsx index e4dfd9e..6a947d4 100644 --- a/src/components/Player/index.tsx +++ b/src/components/Player/index.tsx @@ -20,7 +20,7 @@ export function Player({ currentTry }: Props) { const [isReady, setIsReady] = React.useState(false); const CDN_URL = - import.meta.env.VITE_CDN_URL || "https://yena.pinapelz.com/kheardle"; + import.meta.env.VITE_CDN_URL || "localhost"; const dateString = new Date().toISOString().split("T")[0]; diff --git a/src/helpers/fetchInfo.ts b/src/helpers/fetchInfo.ts deleted file mode 100644 index 15cf963..0000000 --- a/src/helpers/fetchInfo.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import { Info } from "../types/info"; - -export const fetchInfo = async (): Promise<Info> => { - const API_URL = import.meta.env.VITE_APP_HEARDLE_API_URL || "http://localhost:3000"; - const response = await fetch(`${API_URL}/info`); - const data = await response.json(); - return data as Info; -}; diff --git a/src/helpers/scoreToEmoji.ts b/src/helpers/scoreToEmoji.ts index 5af1026..af19194 100644 --- a/src/helpers/scoreToEmoji.ts +++ b/src/helpers/scoreToEmoji.ts @@ -1,12 +1,10 @@ import { GuessType, GuessState } from "../types/guess"; import { appName } from "../constants"; -import { fetchInfo } from "./fetchInfo"; export async function scoreToEmoji(guesses: GuessType[]): Promise<string> { const msInDay = 86400000; const todaysDate = new Date(); - const info = await fetchInfo(); - const startDate = new Date(info.startDate); + const startDate = new Date(import.meta.env.VITE_START_DATE); const index = Math.floor((todaysDate.getTime() - startDate.getTime() )/msInDay) + 1 const emojis = { incorrect: "🟥", |
