From c17da2c93eab9735123b5b091242ad431c169ca9 Mon Sep 17 00:00:00 2001 From: axolotle Date: Sun, 11 Aug 2024 18:16:39 +0200 Subject: [PATCH] fix: add maybeMainDomain getter which do not error out --- app/src/composables/data.ts | 1 + app/src/composables/useInfos.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/composables/data.ts b/app/src/composables/data.ts index 8a1afa76..3db1b7ad 100644 --- a/app/src/composables/data.ts +++ b/app/src/composables/data.ts @@ -161,6 +161,7 @@ export function useDomains(domain_?: MaybeRefOrGetter) { } return { + maybeMainDomain: mainDomain, mainDomain: computed(() => { if (!mainDomain.value) throw new Error(getNoDataMessage('mainDomain')) return mainDomain.value diff --git a/app/src/composables/useInfos.ts b/app/src/composables/useInfos.ts index 5ade1292..c8218540 100644 --- a/app/src/composables/useInfos.ts +++ b/app/src/composables/useInfos.ts @@ -24,9 +24,9 @@ export const useInfos = createGlobalState(() => { const routerKey = ref() const breadcrumb = ref([]) - const { mainDomain } = useDomains() + const { maybeMainDomain } = useDomains() const ssoLink = computed(() => { - return `//${mainDomain.value ?? host.value}/yunohost/sso` + return `//${maybeMainDomain.value ?? host.value}/yunohost/sso` }) // INIT