From 08cce06b2c5dd215ac61dbcc01282f9e6598d2bb Mon Sep 17 00:00:00 2001 From: Thomas Burko Date: Fri, 10 Nov 2023 12:51:57 +0100 Subject: [PATCH] change push, wait for domains loading --- frontend-vue/src/pages/domain-details/DomainDetails.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend-vue/src/pages/domain-details/DomainDetails.vue b/frontend-vue/src/pages/domain-details/DomainDetails.vue index acb1811f..7425e166 100644 --- a/frontend-vue/src/pages/domain-details/DomainDetails.vue +++ b/frontend-vue/src/pages/domain-details/DomainDetails.vue @@ -215,6 +215,7 @@ import ContextureTooltip from "~/components/primitives/tooltip/ContextureTooltip import { useBoundedContextsStore } from "~/stores/boundedContexts"; import { useDomainsStore } from "~/stores/domains"; import { Domain, UpdateDomain } from "~/types/domain"; +import { useRouter } from "vue-router"; const { t } = useI18n(); const domainStore = useDomainsStore(); @@ -232,6 +233,7 @@ const boundedContexts = computed(() => boundedContextsByDomainId.value[currentDo const viewOptions = ["subdomain", "boundedContext"]; const selectedView = useRouteQuery("view", "subdomain", { mode: "push" }); const selectedTab = computed(() => viewOptions.indexOf(selectedView.value)); +const router = useRouter(); function onTabChange(newSelectedTab: number): void { selectedView.value = viewOptions[newSelectedTab]; @@ -290,8 +292,11 @@ async function onSave(values: UpdateDomain) { } watchEffect(() => { + if (loading) { + return; + } if (subdomains.value.length === 0) { - onTabChange(viewOptions.indexOf(viewOptions[1])); // Set the second tab as active + router.replace({ query: { view: viewOptions[1] } }); } });