bugfix: set ui language according to game language
This commit is contained in:
parent
376a9f5642
commit
dce33d2088
@ -1,5 +1,5 @@
|
||||
import { navigateTo } from "#app"
|
||||
import { useUserinfoStore, Userinfo } from "@/stores/UserinfoStore"
|
||||
import useI18n from "./useI18n"
|
||||
import { $fetch } from 'ohmyfetch'
|
||||
|
||||
export type AllowRole = '' | 'player' | 'gamemaster' | 'admin'
|
||||
@ -19,6 +19,7 @@ export default (): useAuth => {
|
||||
try {
|
||||
const userInfo = await $fetch('/api/userinfo') as Userinfo
|
||||
user.setUserInfo(userInfo)
|
||||
useI18n({}).setLang(userInfo.lang)
|
||||
if (allowRoles.indexOf(userInfo.role) >= 0 ) {
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user