mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Fix Cypress test
This commit is contained in:
parent
d0985ca804
commit
8a20b994cf
@ -22,13 +22,15 @@ export default ({ app, req, cookie, store }) => {
|
||||
if (process.server) return
|
||||
|
||||
const newLocale = mutation.payload.locale
|
||||
let isCookie = true
|
||||
let currentLocale = await app.$cookies.get(key)
|
||||
if (!currentLocale) {
|
||||
isCookie = false
|
||||
currentLocale = navigator.language.split('-')[0] // get browser language
|
||||
}
|
||||
const isDifferent = newLocale !== currentLocale
|
||||
|
||||
if (!isDifferent) {
|
||||
if (isCookie && !isDifferent) { // cookie has to be set, otherwise Cypress test does not work
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user