From 4f40c64101fd2cb3f3ee91d0110ca14358df54ca Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 22 Sep 2022 09:11:45 -0400 Subject: [PATCH] fix: Share links containing share links can lead to 'Not found' pages --- app/components/Editor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/Editor.tsx b/app/components/Editor.tsx index 06dbd0606a37..0397fc7c7e80 100644 --- a/app/components/Editor.tsx +++ b/app/components/Editor.tsx @@ -160,7 +160,9 @@ function Editor(props: Props, ref: React.RefObject | null) { } } - if (shareId) { + // If we're navigating to an internal document link then prepend the + // share route to the URL so that the document is loaded in context + if (shareId && navigateTo.includes("/doc/")) { navigateTo = sharedDocumentPath(shareId, navigateTo); }