aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/fetchInfo.ts9
-rw-r--r--src/helpers/scoreToEmoji.ts4
2 files changed, 1 insertions, 12 deletions
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: "🟥",
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage