bugfix: not selecting component after add

This commit is contained in:
Michael Shanks 2020-05-29 14:56:21 +01:00
parent cd9f539a09
commit 46da102670
3 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,5 @@
<script> <script>
import { goto } from "@sveltech/routify"
import { splitName } from "./pagesParsing/splitRootComponentName.js" import { splitName } from "./pagesParsing/splitRootComponentName.js"
import components from "./temporaryPanelStructure.js" import components from "./temporaryPanelStructure.js"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"
@ -32,7 +33,15 @@
const onComponentChosen = component => { const onComponentChosen = component => {
store.addChildComponent(component._component) store.addChildComponent(component._component)
toggleTab("Navigate") toggleTab("Navigate")
// Get ID path
const path = store.getPathToComponent($store.currentComponentInfo)
// Go to correct URL
$goto(`./:page/:screen/${path}`)
} }
</script> </script>

View File

@ -20,7 +20,8 @@
}, },
] ]
store.setCurrentPage($params.page ? $params.page : "main") if (!$store.currentPageName)
store.setCurrentPage($params.page ? $params.page : "main")
const changePage = id => { const changePage = id => {
store.setCurrentPage(id) store.setCurrentPage(id)

View File

@ -55,7 +55,8 @@
<FrontendNavigatePane /> <FrontendNavigatePane />
</div> </div>
<div slot="1"> <div slot="1">
<ComponentSelectionList toggleTab={leftNavSwitcher.selectTab} /> </div> <ComponentSelectionList toggleTab={leftNavSwitcher.selectTab} />
</div>
</Switcher> </Switcher>