Skip to content

Commit

Permalink
fix: Prevent redirect failure when accessing a dynamic route with det…
Browse files Browse the repository at this point in the history
…ectBrowserLanguage enabled (#266)
  • Loading branch information
rchl authored and paulgv committed Apr 27, 2019
1 parent f648b72 commit b7adba0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ module.exports = {
// Allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
// Do not allow console.logs etc...
'no-console': 1
'no-console': 1,
// Disalow semicolons
'semi': ['error', 'never']
},
globals: {
'jest/globals': true,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default async (context) => {

if (store && store.state.localeDomains) {
app.i18n.locales.forEach(locale => {
locale.domain = store.state.localeDomains[locale.code];
locale.domain = store.state.localeDomains[locale.code]
})
}

Expand Down
5 changes: 5 additions & 0 deletions src/plugins/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ function localePathFactory (i18nPath, routerPath) {

const localizedRoute = Object.assign({}, route, { name })

const { params } = localizedRoute
if (params && params['0'] === undefined && params.pathMatch) {
params['0'] = params.pathMatch
}

// Resolve localized route
const router = this[routerPath]
const resolved = router.resolve(localizedRoute)
Expand Down

0 comments on commit b7adba0

Please sign in to comment.