correction for production embed envirnments

This commit is contained in:
2026-02-27 17:18:37 -06:00
parent 17d0aaa2ff
commit bde9cc7047
+8 -2
View File
@@ -115,8 +115,14 @@ const App: Component = () => {
<Show when={getEmbedView() === 'embed_notes'}>
{(() => {
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 <NotepadView selectedNoteId={noteIdFromUrl()} setSelectedNoteId={() => { }} hideNavigation={!!noteIdFromUrl()} />;