Clean code
This commit is contained in:
parent
3f10a3404c
commit
d322f85acf
|
@ -56,7 +56,7 @@ export class ComponentTreeNodesStore extends BudiStore<OpenNodesState> {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = findComponentPath(selectedScreen?.props, componentId)
|
const path = findComponentPath(selectedScreen.props, componentId)
|
||||||
|
|
||||||
const componentIds = path.map((component: Component) => component._id)
|
const componentIds = path.map((component: Component) => component._id)
|
||||||
|
|
||||||
|
|
|
@ -483,9 +483,8 @@ export class ComponentStore extends BudiStore<ComponentState> {
|
||||||
extras._children = []
|
extras._children = []
|
||||||
}
|
}
|
||||||
|
|
||||||
const $selectedScreen = get(selectedScreen)
|
|
||||||
// Add step name to form steps
|
// Add step name to form steps
|
||||||
if (componentName.endsWith("/formstep") && $selectedScreen) {
|
if (componentName.endsWith("/formstep")) {
|
||||||
const parentForm = findClosestMatchingComponent(
|
const parentForm = findClosestMatchingComponent(
|
||||||
screen.props,
|
screen.props,
|
||||||
get(selectedComponent)._id,
|
get(selectedComponent)._id,
|
||||||
|
@ -621,7 +620,7 @@ export class ComponentStore extends BudiStore<ComponentState> {
|
||||||
const state = get(this.store)
|
const state = get(this.store)
|
||||||
componentId = componentId ?? state.selectedComponentId ?? undefined
|
componentId = componentId ?? state.selectedComponentId ?? undefined
|
||||||
const screenState = get(screenStore)
|
const screenState = get(screenStore)
|
||||||
screenId = (screenId || screenState.selectedScreenId) ?? undefined
|
screenId = screenId || screenState.selectedScreenId
|
||||||
}
|
}
|
||||||
if (!componentId || !screenId || !patchFn) {
|
if (!componentId || !screenId || !patchFn) {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue