diff --git a/src/App.tsx b/src/App.tsx index c15edc4..34eb022 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -115,8 +115,14 @@ const App: Component = () => { {(() => { const noteIdFromUrl = createMemo(() => { - const params = new URLSearchParams(new URL(location()).search); - return params.get('noteId'); + const urlObj = new URL(location()); + let noteId = new URLSearchParams(urlObj.search).get('noteId'); + // Production likely uses hash routing, so check hash for query params too + if (!noteId && urlObj.hash.includes('?')) { + const hashQueryString = urlObj.hash.substring(urlObj.hash.indexOf('?')); + noteId = new URLSearchParams(hashQueryString).get('noteId'); + } + return noteId; }); console.log('[DEBUG App] Rendering embed/notes context. noteId trace:', noteIdFromUrl()); return { }} hideNavigation={!!noteIdFromUrl()} />;