diff options
Diffstat (limited to 'packages/frontend/src/pages/admin/index.vue')
| -rw-r--r-- | packages/frontend/src/pages/admin/index.vue | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/packages/frontend/src/pages/admin/index.vue b/packages/frontend/src/pages/admin/index.vue index 794669d6b5..f547bedacb 100644 --- a/packages/frontend/src/pages/admin/index.vue +++ b/packages/frontend/src/pages/admin/index.vue @@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only <div ref="el" class="hiyeyicy" :class="{ wide: !narrow }"> <div v-if="!narrow || currentPage?.route.name == null" class="nav"> <MkSpacer :contentMax="700" :marginMin="16"> - <div class="lxpfedzu"> + <div class="lxpfedzu _gaps"> <div class="banner"> <img :src="instance.iconUrl || '/favicon.ico'" alt="" class="icon"/> </div> @@ -62,10 +62,10 @@ const narrow = ref(false); const view = ref(null); const el = ref<HTMLDivElement | null>(null); const pageProps = ref({}); -let noMaintainerInformation = isEmpty(instance.maintainerName) || isEmpty(instance.maintainerEmail); -let noBotProtection = !instance.disableRegistration && !instance.enableHcaptcha && !instance.enableRecaptcha && !instance.enableMcaptcha && !instance.enableTurnstile; -let noEmailServer = !instance.enableEmail; -let noInquiryUrl = isEmpty(instance.inquiryUrl); +const noMaintainerInformation = computed(() => isEmpty(instance.maintainerName) || isEmpty(instance.maintainerEmail)); +const noBotProtection = computed(() => !instance.disableRegistration && !instance.enableHcaptcha && !instance.enableRecaptcha && !instance.enableTurnstile && !instance.enableMcaptcha); +const noEmailServer = computed(() => !instance.enableEmail); +const noInquiryUrl = computed(() => isEmpty(instance.inquiryUrl)); const thereIsUnresolvedAbuseReport = ref(false); const pendingUserApprovals = ref(false); const currentPage = computed(() => router.currentRef.value.child); @@ -250,25 +250,22 @@ const menuDef = computed(() => [{ }], }]); -watch(narrow.value, () => { - if (currentPage.value?.route.name == null && !narrow.value) { - router.push('/admin/overview'); - } -}); - onMounted(() => { - ro.observe(el.value); - - narrow.value = el.value.offsetWidth < NARROW_THRESHOLD; + if (el.value != null) { + ro.observe(el.value); + narrow.value = el.value.offsetWidth < NARROW_THRESHOLD; + } if (currentPage.value?.route.name == null && !narrow.value) { - router.push('/admin/overview'); + router.replace('/admin/overview'); } }); onActivated(() => { - narrow.value = el.value.offsetWidth < NARROW_THRESHOLD; + if (el.value != null) { + narrow.value = el.value.offsetWidth < NARROW_THRESHOLD; + } if (currentPage.value?.route.name == null && !narrow.value) { - router.push('/admin/overview'); + router.replace('/admin/overview'); } }); |