Skip to content

Commit

Permalink
wip: add console.logs for debugging the RAs
Browse files Browse the repository at this point in the history
  • Loading branch information
lego-technix committed Dec 30, 2022
1 parent 8ee23ef commit 098d384
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/locale-observer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export default function ({ app }) {
export default function ({ app, route }) {
window.onNuxtReady(() => {
console.log('window.onNuxtReady')
const cookieLocale = _getLocaleFromCookie()
if (!cookieLocale) return

console.log({ path: route.path })
window.$nuxt.$router.push(`/${cookieLocale}`)
})

Expand Down
9 changes: 9 additions & 0 deletions tests/plugins/locale-observer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ describe('Plugins | locale-observer', () => {
app: {
i18n: {},
},
route: {
path: '/',
},
}

// when
Expand All @@ -39,6 +42,9 @@ describe('Plugins | locale-observer', () => {
app: {
i18n: {},
},
route: {
path: '/',
},
}

// when
Expand All @@ -59,6 +65,9 @@ describe('Plugins | locale-observer', () => {
app: {
i18n: {},
},
route: {
path: '/',
},
}

// when
Expand Down

0 comments on commit 098d384

Please sign in to comment.