diff --git a/app/web/src/components/ModelingDiagram/ModelingDiagram.vue b/app/web/src/components/ModelingDiagram/ModelingDiagram.vue index 305715e846..5908d24888 100644 --- a/app/web/src/components/ModelingDiagram/ModelingDiagram.vue +++ b/app/web/src/components/ModelingDiagram/ModelingDiagram.vue @@ -311,7 +311,6 @@ import { ComponentType } from "@/api/sdf/dal/schema"; import { useStatusStore } from "@/store/status.store"; import { useQualificationsStore } from "@/store/qualifications.store"; import { nonNullable } from "@/utils/typescriptLinter"; -import { ViewId } from "@/api/sdf/dal/views"; import { useFeatureFlagsStore } from "@/store/feature_flags.store"; import { DefaultMap } from "@/utils/defaultmap"; import DiagramGridBackground from "./DiagramGridBackground.vue"; @@ -392,7 +391,6 @@ const ZOOM_PAN_FACTOR = 0.5; const props = defineProps<{ cursors?: DiagramCursorDef[]; - viewId: ViewId | undefined; readOnly?: boolean; }>(); diff --git a/app/web/src/components/Workspace/WorkspaceModelAndView.vue b/app/web/src/components/Workspace/WorkspaceModelAndView.vue index 2306802803..8e5e7a2807 100644 --- a/app/web/src/components/Workspace/WorkspaceModelAndView.vue +++ b/app/web/src/components/Workspace/WorkspaceModelAndView.vue @@ -53,7 +53,6 @@ { onMounted(() => { window.addEventListener("keydown", onKeyDown); statusStore.FETCH_DVU_ROOTS(); + if (!viewStore.selectedViewId && !viewStore.activatedAndFetched) + viewStore.FETCH_VIEW(viewId.value); }); onBeforeUnmount(() => { diff --git a/app/web/src/store/views.store.ts b/app/web/src/store/views.store.ts index 55a67bbacd..03748640e7 100644 --- a/app/web/src/store/views.store.ts +++ b/app/web/src/store/views.store.ts @@ -182,6 +182,7 @@ export const useViewsStore = (forceChangeSetId?: ChangeSetId) => { changeSetId, defineStore(`ws${workspaceId || "NONE"}/cs${changeSetId || "NONE"}/views`, { state: () => ({ + activatedAndFetched: false, selectedViewId: null as ViewId | null, outlinerViewId: null as ViewId | null, recentViews: new UniqueStack() as UniqueStack, @@ -1590,6 +1591,7 @@ export const useViewsStore = (forceChangeSetId?: ChangeSetId) => { route?.name as string, ) ) { + this.activatedAndFetched = true; if (route?.params.viewId) viewId = route.params.viewId as string; await this.FETCH_VIEW(viewId); // ^ selects the view