Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert history store #15408

Merged
merged 23 commits into from
Jan 30, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean code
adrinr committed Jan 27, 2025
commit d322f85acfb70499c44facda56fe5f83749faddb
2 changes: 1 addition & 1 deletion packages/builder/src/stores/builder/componentTreeNodes.ts
Original file line number Diff line number Diff line change
@@ -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)

5 changes: 2 additions & 3 deletions packages/builder/src/stores/builder/components.ts
Original file line number Diff line number Diff line change
@@ -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