fix: add maybeMainDomain getter which do not error out

This commit is contained in:
axolotle 2024-08-11 18:16:39 +02:00
parent 1f1dac1792
commit c17da2c93e
2 changed files with 3 additions and 2 deletions

View file

@ -161,6 +161,7 @@ export function useDomains(domain_?: MaybeRefOrGetter<string>) {
}
return {
maybeMainDomain: mainDomain,
mainDomain: computed(() => {
if (!mainDomain.value) throw new Error(getNoDataMessage('mainDomain'))
return mainDomain.value

View file

@ -24,9 +24,9 @@ export const useInfos = createGlobalState(() => {
const routerKey = ref<string | undefined>()
const breadcrumb = ref<CustomRoute[]>([])
const { mainDomain } = useDomains()
const { maybeMainDomain } = useDomains()
const ssoLink = computed(() => {
return `//${mainDomain.value ?? host.value}/yunohost/sso`
return `//${maybeMainDomain.value ?? host.value}/yunohost/sso`
})
// INIT