mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
catch language when comming back from admin interface
This commit is contained in:
parent
a679b90425
commit
b244f31a53
@ -28,7 +28,7 @@ Vue.toasted.register(
|
||||
|
||||
loadAllRules(i18n)
|
||||
|
||||
addNavigationGuards(router, store, apolloProvider.defaultClient)
|
||||
addNavigationGuards(router, store, apolloProvider.defaultClient, i18n)
|
||||
|
||||
if (!store) {
|
||||
setTimeout(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { verifyLogin } from '../graphql/queries'
|
||||
|
||||
const addNavigationGuards = (router, store, apollo) => {
|
||||
const addNavigationGuards = (router, store, apollo, i18n) => {
|
||||
// handle publisherId
|
||||
router.beforeEach((to, from, next) => {
|
||||
const publisherId = to.query.pid
|
||||
@ -21,6 +21,7 @@ const addNavigationGuards = (router, store, apollo) => {
|
||||
fetchPolicy: 'network-only',
|
||||
})
|
||||
.then((result) => {
|
||||
i18n.locale = result.data.verifyLogin.language
|
||||
store.dispatch('login', result.data.verifyLogin)
|
||||
next({ path: '/overview' })
|
||||
})
|
||||
|
||||
@ -23,7 +23,11 @@ const apollo = {
|
||||
query: apolloQueryMock,
|
||||
}
|
||||
|
||||
addNavigationGuards(router, store, apollo)
|
||||
const i18n = {
|
||||
locale: jest.fn(),
|
||||
}
|
||||
|
||||
addNavigationGuards(router, store, apollo, i18n)
|
||||
|
||||
describe('navigation guards', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user