fix client init

This commit is contained in:
jb-alvarado 2024-08-22 19:56:05 +02:00
parent 4d38a74306
commit 90dcd3b23e
3 changed files with 7 additions and 5 deletions

View File

@ -5,3 +5,8 @@
</NuxtLayout>
</div>
</template>
<script setup lang="ts">
const configStore = useConfig()
await useAsyncData('init', () => configStore.configInit())
</script>

View File

@ -14,14 +14,11 @@
<script setup lang="ts">
const colorMode = useColorMode()
const configStore = useConfig()
const authStore = useAuth()
const indexStore = useIndex()
const route = useRoute()
await configStore.nuxtClientInit()
if (colorMode.value === 'dark') {
indexStore.darkMode = true
} else {

View File

@ -20,14 +20,14 @@ export const useConfig = defineStore('config', {
getters: {},
actions: {
async nuxtClientInit() {
async configInit() {
const authStore = useAuth()
authStore.inspectToken()
if (authStore.isLogin) {
await authStore.obtainUuid()
this.getChannelConfig().then(async () => {
await this.getChannelConfig().then(async () => {
await this.getPlayoutConfig()
await this.getUserConfig()