Clean code

This commit is contained in:
Adria Navarro 2025-01-27 16:02:59 +01:00
parent 3f10a3404c
commit d322f85acf
2 changed files with 3 additions and 4 deletions

View File

@ -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)

View File

@ -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