fix: Broken external links on shared docs, closes #6962

This commit is contained in:
Tom Moor
2024-05-29 07:10:34 -04:00
parent d866d28c6e
commit 14df74d776

View File

@@ -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]