keep search params when decoding url on frontend

This commit is contained in:
Sean Yesmunt 2020-03-30 16:47:07 -04:00
parent 27397285bc
commit 1e2714723f

View file

@ -131,9 +131,9 @@ function AppRouter(props: Props) {
// react-router doesn't decode pathanmes before doing the route matching check // react-router doesn't decode pathanmes before doing the route matching check
// We have to redirect here because if we redirect on the server, it might get encoded again // We have to redirect here because if we redirect on the server, it might get encoded again
// in the browser causing a redirect loop // in the browser causing a redirect loop
const decodedPathname = decodeURIComponent(pathname); const decodedUrl = decodeURIComponent(pathname + search);
if (decodedPathname !== pathname) { if (decodedUrl !== pathname + search) {
return <Redirect to={decodedPathname} />; return <Redirect to={decodedUrl} />;
} }
return ( return (