Handle relative urls

This commit is contained in:
Tom Moor 2018-06-26 23:43:19 -07:00
parent 6bd53b72b2
commit 2f839c75f7
1 changed files with 6 additions and 0 deletions

View File

@ -234,6 +234,12 @@ class DocumentScene extends React.Component<Props> {
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 {