File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ export function setupRouter(i18n: I18n): Router {
38
38
} )
39
39
40
40
// navigation guards
41
- router . beforeEach ( async ( to , from , next ) => {
42
- const paramsLocale = ( to . params as any ) . locale as string
41
+ router . beforeEach ( async to => {
42
+ const paramsLocale = to . params . locale as string
43
43
44
44
// use locale if paramsLocale is not in SUPPORT_LOCALES
45
45
if ( ! SUPPORT_LOCALES . includes ( paramsLocale ) ) {
46
- return next ( `/${ locale } ` )
46
+ return `/${ locale } `
47
47
}
48
48
49
49
// load locale messages
@@ -53,8 +53,6 @@ export function setupRouter(i18n: I18n): Router {
53
53
54
54
// set i18n language
55
55
setI18nLanguage ( i18n , paramsLocale )
56
-
57
- return next ( )
58
56
} )
59
57
60
58
return router
Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ export function setupRouter(i18n) {
33
33
} )
34
34
35
35
// navigation guards
36
- router . beforeEach ( async ( to , from , next ) => {
36
+ router . beforeEach ( async to => {
37
37
const paramsLocale = to . params . locale
38
38
39
39
// use locale if paramsLocale is not in SUPPORT_LOCALES
40
40
if ( ! SUPPORT_LOCALES . includes ( paramsLocale ) ) {
41
- return next ( `/${ locale } ` )
41
+ return `/${ locale } `
42
42
}
43
43
44
44
// load locale messages
@@ -48,8 +48,6 @@ export function setupRouter(i18n) {
48
48
49
49
// set i18n language
50
50
setI18nLanguage ( i18n , paramsLocale )
51
-
52
- return next ( )
53
51
} )
54
52
55
53
return router
You can’t perform that action at this time.
0 commit comments