From 4834656b97b4f56e1b48f2e935df0776d844c5b6 Mon Sep 17 00:00:00 2001 From: TheDanniCraft Date: Wed, 30 Oct 2024 12:46:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20window=20is=20not=20define?= =?UTF-8?q?d,=20removed=20debug=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.js | 11 ++++++++--- src/i18n/request.js | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/page.js b/src/app/page.js index ece4b76..4d27ad5 100644 --- a/src/app/page.js +++ b/src/app/page.js @@ -26,12 +26,17 @@ export default function Home() { const [pendingFiles, setPendingFiles] = useState(null); const [userPhrase, setUserPhrase] = useState(''); const [opened, { open, close }] = useDisclosure(false); + const [origin, setOrigin] = useState(''); const searchParams = useSearchParams(); const { SVG } = useQRCode(); const DEFAULT_DURATION = 2; // hours const EXTEND_DURATION = 7; // days + useEffect(() => { + setOrigin(window.location.origin); + }, []); + const handleInputChange = useCallback(async (newCode) => { setKeyError(false); @@ -208,7 +213,7 @@ export default function Home() { w="auto" fit="contain" src="/QuickDropIconText.svg" - onClick={() => window.location.href = window.location.origin} + onClick={() => window.location.href = origin} style={{ cursor: 'pointer' }} /> @@ -329,7 +334,7 @@ export default function Home() {
{ console.error('Error sharing:', error); }); diff --git a/src/i18n/request.js b/src/i18n/request.js index 2bd1ba9..9176dae 100644 --- a/src/i18n/request.js +++ b/src/i18n/request.js @@ -9,7 +9,6 @@ const timeZonesByLang = { export default getRequestConfig(async () => { const acceptLanguage = headers().get('accept-language') || 'en'; - console.log(acceptLanguage); let locale = acceptLanguage.split(',')[0].split('-')[0]; try {