correction for production embed envirnments
This commit is contained in:
+8
-2
@@ -115,8 +115,14 @@ const App: Component = () => {
|
|||||||
<Show when={getEmbedView() === 'embed_notes'}>
|
<Show when={getEmbedView() === 'embed_notes'}>
|
||||||
{(() => {
|
{(() => {
|
||||||
const noteIdFromUrl = createMemo(() => {
|
const noteIdFromUrl = createMemo(() => {
|
||||||
const params = new URLSearchParams(new URL(location()).search);
|
const urlObj = new URL(location());
|
||||||
return params.get('noteId');
|
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());
|
console.log('[DEBUG App] Rendering embed/notes context. noteId trace:', noteIdFromUrl());
|
||||||
return <NotepadView selectedNoteId={noteIdFromUrl()} setSelectedNoteId={() => { }} hideNavigation={!!noteIdFromUrl()} />;
|
return <NotepadView selectedNoteId={noteIdFromUrl()} setSelectedNoteId={() => { }} hideNavigation={!!noteIdFromUrl()} />;
|
||||||
|
|||||||
Reference in New Issue
Block a user