Dark mode fix first page loading

This commit is contained in:
Surya Paolo
2022-11-29 15:25:06 +01:00
parent 1ab75a58f4
commit d6f537473e
6 changed files with 30 additions and 18 deletions

View File

@@ -35,6 +35,8 @@ export default {
const site = computed(() => globalStore.site)
const darkcookie = ref(false)
watch(() => finishLoading.value, (newval: boolean, oldval: boolean) => {
// console.log('watch finished', newval)
if (newval) {
@@ -44,6 +46,7 @@ export default {
})
const listaRoutingNoLogin = ['/vreg?', '/offline']
function meta() {
@@ -75,6 +78,8 @@ export default {
}
function mounted() {
darkcookie.value = tools.getCookie('darkmode', false, false, false) === '-1'
scroll()
}
@@ -130,6 +135,7 @@ export default {
return {
finishLoading,
darkcookie,
}
},
}