Skip to content

Commit

Permalink
Merge pull request #5153 from systeminit/fix/navbar-remembers-what-vi…
Browse files Browse the repository at this point in the history
…ew-you-are-in

Fix: navbar remembers what view you're in
  • Loading branch information
stack72 authored Dec 18, 2024
2 parents d254784 + 82cc94e commit f97f5ff
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions app/web/src/components/layout/navbar/NavbarPanelCenter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
:selected="
['workspace-compose', 'workspace-compose-view'].includes(route.name as string)
"
:linkTo="{
name: 'workspace-compose',
params: { changeSetId: 'auto' },
}"
:linkTo="modelingLink()"
/>

<NavbarButton
Expand Down Expand Up @@ -40,8 +37,35 @@
<script setup lang="ts">
import { useRoute } from "vue-router";
import { useFeatureFlagsStore } from "@/store/feature_flags.store";
import { useViewsStore } from "@/store/views.store";
import { useChangeSetsStore } from "@/store/change_sets.store";
import NavbarButton from "./NavbarButton.vue";
const route = useRoute();
const featureFlagsStore = useFeatureFlagsStore();
const modelingLink = () => {
const viewsStore = useViewsStore();
const changeSetStore = useChangeSetsStore();
if (changeSetStore.selectedChangeSetId) {
if (viewsStore.selectedViewId) {
return {
name: "workspace-compose-view",
params: {
changeSetId: changeSetStore.selectedChangeSetId,
viewId: viewsStore.selectedViewId,
},
};
} else {
return {
name: "workspace-compose",
params: { changeSetId: changeSetStore.selectedChangeSetId },
};
}
}
return {
name: "workspace-compose",
params: { changeSetId: "auto" },
};
};
</script>

0 comments on commit f97f5ff

Please sign in to comment.