From 54091960082310d04a705a0c0947cc7793aca929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6rdle=20Bot?= Date: Tue, 2 Dec 2025 09:40:15 +0100 Subject: [PATCH] fix: Update domain handling for sharing URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Modify currentHost logic to always share "hördle.de" instead of the Punycode variant when applicable. - Ensure compatibility with both hoerdle.de and hördle.de for improved user experience. --- components/Game.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/Game.tsx b/components/Game.tsx index d37740c..7a51806 100644 --- a/components/Game.tsx +++ b/components/Game.tsx @@ -284,8 +284,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` : ''; - // 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; + // Use current domain from window.location to support both hoerdle.de and hördle.de, + // but always share the pretty Unicode-Domain "hördle.de" instead of the Punycode variant. + const rawHost = typeof window !== 'undefined' ? window.location.hostname : config.domain; + const currentHost = rawHost === 'xn--hrdle-jua.de' ? 'hördle.de' : rawHost; const protocol = typeof window !== 'undefined' ? window.location.protocol : 'https:'; let shareUrl = `${protocol}//${currentHost}`; // Add locale prefix if not default (en)