From 2f839c75f786eb423bf6989681ae198c3c53851e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 26 Jun 2018 23:43:19 -0700 Subject: [PATCH] Handle relative urls --- app/scenes/Document/Document.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index 0cf0dc728..23ef41cf8 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -234,6 +234,12 @@ class DocumentScene extends React.Component { onClickLink = (href: string) => { if (isInternalUrl(href)) { + // relative + if (href[0] === '/') { + this.props.history.push(href); + } + + // absolute const url = new URL(href); this.props.history.push(url.pathname); } else {