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