diff --git a/packages/builder/src/builderStore/store.js b/packages/builder/src/builderStore/store.js index 0c69f5675b..1eb2a2b698 100644 --- a/packages/builder/src/builderStore/store.js +++ b/packages/builder/src/builderStore/store.js @@ -274,13 +274,13 @@ const saveCurrentNode = store => () => { const cloned = cloneDeep(s.currentNode) templateApi(s.hierarchy).constructNode(parentNode, cloned) - const newIndexOfchild = child => { + const newIndexOfChild = child => { if (child === cloned) return index const currentIndex = parentNode.children.indexOf(child) return currentIndex >= index ? currentIndex + 1 : currentIndex } - parentNode.children = pipe(parentNode.children, [sortBy(newIndexOfchild)]) + parentNode.children = pipe(parentNode.children, [sortBy(newIndexOfChild)]) if (!existingNode && s.currentNode.type === "record") { const defaultIndex = templateApi(s.hierarchy).getNewIndexTemplate( diff --git a/packages/builder/src/database/ActionsHeader.svelte b/packages/builder/src/database/ActionsHeader.svelte index 5490ec2df8..71e3e8abdc 100644 --- a/packages/builder/src/database/ActionsHeader.svelte +++ b/packages/builder/src/database/ActionsHeader.svelte @@ -19,9 +19,11 @@
- - + {#if $store.currentNodeIsNew}Create{:else}Update{/if} diff --git a/packages/builder/src/nav/HierarchyRow.svelte b/packages/builder/src/nav/HierarchyRow.svelte index 5ae0a59baa..81d5c4ec22 100644 --- a/packages/builder/src/nav/HierarchyRow.svelte +++ b/packages/builder/src/nav/HierarchyRow.svelte @@ -9,10 +9,11 @@ let navActive = "" $: icon = type === "index" ? "list" : "file" - store.subscribe(s => { - if (s.currentNode) + store.subscribe(state => { + if (state.currentNode) { navActive = - s.activeNav === "database" && node.nodeId === s.currentNode.nodeId + state.activeNav === "database" && node.nodeId === state.currentNode.nodeId + } }) diff --git a/packages/builder/src/userInterface/CodeEditor.svelte b/packages/builder/src/userInterface/CodeEditor.svelte index 381e032480..efa571332b 100644 --- a/packages/builder/src/userInterface/CodeEditor.svelte +++ b/packages/builder/src/userInterface/CodeEditor.svelte @@ -1,7 +1,7 @@