Fix QueryLink not linking to the correct URL format

This caused the href view in browsers to show the incorrect URL, and also broke stuff like opening the link in a new tab
This commit is contained in:
birjolaxew 2020-11-13 01:46:48 +01:00
parent 7f1f3a00ec
commit f95f310eb7

View File

@ -82,7 +82,11 @@ class QueryLink extends React.Component {
render() {
const { history, query, to, ...props } = this.props
return <Link {...props} to={generateQueryString(to)} onClick={this.onClick} />
return <Link
{...props}
to={{ pathname: window.location.pathname, search: generateQueryString(to) }}
onClick={this.onClick}
/>
}
}
const QueryLinkWithRouter = withRouter(QueryLink)