From 1a47e30a98bd9d4742197ec8df1b5633ca110c42 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 26 Jun 2026 22:16:30 -0700 Subject: add share button for daily mv mode --- src/components/Result/index.tsx | 7 ------- src/helpers/scoreToEmoji.ts | 7 +++++-- src/react-app-env.d.ts | 1 + 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/Result/index.tsx b/src/components/Result/index.tsx index 46959a6..21d1a1b 100644 --- a/src/components/Result/index.tsx +++ b/src/components/Result/index.tsx @@ -106,13 +106,6 @@ export function Result({ onPlayAgain, }: Props) { const [timeLeftStr, setTimeLeftStr] = useState(''); - const now = new Date(); - const nextUtcMidnight = Date.UTC( - now.getUTCFullYear(), - now.getUTCMonth(), - now.getUTCDate() + 1, - 0, 0, 0 - ); React.useEffect(() => { const updateTimeLeft = () => { diff --git a/src/helpers/scoreToEmoji.ts b/src/helpers/scoreToEmoji.ts index 4e0df54..fb71229 100644 --- a/src/helpers/scoreToEmoji.ts +++ b/src/helpers/scoreToEmoji.ts @@ -4,7 +4,7 @@ import { appName } from "../constants"; export async function scoreToEmoji(guesses: GuessType[]): Promise { const msInDay = 24 * 60 * 60 * 1000; const today = new Date(); - const startDate = new Date(import.meta.env.VITE_START_DATE); + const startDate = new Date(import.meta.env.VITE_START_DATE || today.toISOString()); const currentPageUrl = window.location.href; const index = Math.floor( @@ -19,7 +19,10 @@ export async function scoreToEmoji(guesses: GuessType[]): Promise { skip: "⬜", empty: "⬛️", }; - const prefix = `${appName} - #${index}`; + let prefix = `${appName} (Daily Heardle) - #${index}`; + if (currentPageUrl.endsWith("mv")) { + prefix = `${appName} (Daily MV) - #${index}`; + } let scoreEmoji = ""; diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index ac88680..cfb4b82 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -5,6 +5,7 @@ declare global { readonly VITE_CDN_URL?: string; readonly VITE_HEARDLE_SALT?: string; readonly VITE_HEARDLE_API_URL?: string; + readonly VITE_START_DATE?: string; } interface ImportMeta { -- cgit v1.2.3