From bba6b9ef31d6770fc4e01b5e4f5e722b26c75c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6rdle=20Bot?= Date: Mon, 1 Dec 2025 19:53:26 +0100 Subject: [PATCH] fix: Use current domain in share URL instead of static config.domain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Share URL now uses window.location.hostname to support both hoerdle.de and hördle.de - Protocol is automatically detected from window.location.protocol - Fixes issue where share URL always used hoerdle.de even when accessed via hördle.de --- components/Game.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/Game.tsx b/components/Game.tsx index 5335fe2..49fcce0 100644 --- a/components/Game.tsx +++ b/components/Game.tsx @@ -274,7 +274,10 @@ export default function Game({ dailyPuzzle, genre = null, isSpecial = false, max const bonusStar = (hasWon && gameState.yearGuessed && dailyPuzzle.releaseYear && gameState.scoreBreakdown.some(item => item.reason === 'Bonus: Correct Year')) ? '⭐' : ''; const genreText = genre ? `${isSpecial ? t('special') : t('genre')}: ${genre}\n` : ''; - let shareUrl = `https://${config.domain}`; + // Use current domain from window.location to support both hoerdle.de and hördle.de + const currentHost = typeof window !== 'undefined' ? window.location.hostname : config.domain; + const protocol = typeof window !== 'undefined' ? window.location.protocol : 'https:'; + let shareUrl = `${protocol}//${currentHost}`; // Add locale prefix if not default (en) if (locale !== 'en') { shareUrl += `/${locale}`;