Skip to content

Commit

Permalink
Fix query params on redirect with lang-path (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored Jul 2, 2020
1 parent fbcd0c8 commit fa448f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cli/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ import C from './${defaultLanguage}/index'
export default function Index(props) {
const router = useRouter()
useEffect(() => { router.replace('/${defaultLanguage}') }, [])
useEffect(() => { router.replace('/${defaultLanguage}'+location.search) }, [])
return <C {...props} />
}
Expand Down Expand Up @@ -339,7 +339,7 @@ export default function CatchAll() {
if (router.query.path[0] === '${defaultLanguage}') {
return <Error statusCode="404" />
}
router.replace(\`/${defaultLanguage}/\${router.query.path.join('/')}\`)
router.replace(\`/${defaultLanguage}/\${router.query.path.join('/')}\${location.search}\`)
}
return null
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-translate",
"version": "0.17.2-canary.2",
"version": "0.17.2-canary.3",
"description": "Next.js utility to translate pages without the need of a server (static i18n pages generator).",
"license": "MIT",
"keywords": [
Expand Down

0 comments on commit fa448f1

Please sign in to comment.