From 14df74d7765839fd3d7388eeb107931abe23246c Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 29 May 2024 07:10:34 -0400 Subject: [PATCH] fix: Broken external links on shared docs, closes #6962 --- app/hooks/useEditorClickHandlers.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/hooks/useEditorClickHandlers.ts b/app/hooks/useEditorClickHandlers.ts index 701292ca3..f71652842 100644 --- a/app/hooks/useEditorClickHandlers.ts +++ b/app/hooks/useEditorClickHandlers.ts @@ -50,12 +50,14 @@ export default function useEditorClickHandlers({ shareId }: Params) { if (shareId && navigateTo.includes("/doc/")) { navigateTo = sharedDocumentPath(shareId, navigateTo); } - } - if (!isModKey(event) && !event.shiftKey) { - history.push(navigateTo); + if (!isModKey(event) && !event.shiftKey) { + history.push(navigateTo); + } else { + window.open(navigateTo, "_blank"); + } } else { - window.open(navigateTo, "_blank"); + window.open(href, "_blank"); } }, [history, shareId]