Skip to content

Commit

Permalink
change push, wait for domains loading
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-burko committed Nov 10, 2023
1 parent d469c80 commit 08cce06
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend-vue/src/pages/domain-details/DomainDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -232,6 +233,7 @@ const boundedContexts = computed(() => boundedContextsByDomainId.value[currentDo
const viewOptions = ["subdomain", "boundedContext"];
const selectedView = useRouteQuery<string>("view", "subdomain", { mode: "push" });
const selectedTab = computed<number>(() => viewOptions.indexOf(selectedView.value));
const router = useRouter();
function onTabChange(newSelectedTab: number): void {
selectedView.value = viewOptions[newSelectedTab];
Expand Down Expand Up @@ -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] } });
}
});
</script>

0 comments on commit 08cce06

Please sign in to comment.