Skip to content

Commit

Permalink
Merge pull request #5180 from systeminit/fix/initial-land-on-customiz…
Browse files Browse the repository at this point in the history
…e-no-modeling

Fix: initial load on customize page, move to empty modeling page
  • Loading branch information
jobelenus authored Dec 20, 2024
2 parents 34585a3 + 1f7f1e1 commit 81f2c70
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions app/web/src/components/ModelingDiagram/ModelingDiagram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -392,7 +391,6 @@ const ZOOM_PAN_FACTOR = 0.5;

const props = defineProps<{
cursors?: DiagramCursorDef[];
viewId: ViewId | undefined;
readOnly?: boolean;
}>();

Expand Down
3 changes: 2 additions & 1 deletion app/web/src/components/Workspace/WorkspaceModelAndView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<ModelingDiagram
v-else
ref="diagramRef"
:viewId="viewId"
@mouseout="presenceStore.clearCursor"
@right-click-element="onRightClickElement"
@close-right-click-menu="closeRightClickMenu"
Expand Down Expand Up @@ -212,6 +211,8 @@ const onKeyDown = async (e: KeyboardEvent) => {
onMounted(() => {
window.addEventListener("keydown", onKeyDown);
statusStore.FETCH_DVU_ROOTS();
if (!viewStore.selectedViewId && !viewStore.activatedAndFetched)
viewStore.FETCH_VIEW(viewId.value);
});

onBeforeUnmount(() => {
Expand Down
2 changes: 2 additions & 0 deletions app/web/src/store/views.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ViewId>,
Expand Down Expand Up @@ -1596,6 +1597,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
Expand Down

0 comments on commit 81f2c70

Please sign in to comment.