Skip to content

Commit 73cc042

Browse files
fix: wrong condition checked (#1154)
1 parent 9250264 commit 73cc042

File tree

1 file changed

+2
-1
lines changed
  • src/packages/modules-operations/tree

1 file changed

+2
-1
lines changed

src/packages/modules-operations/tree/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const updateParent = (
5252
export const updateTree = (treeData, leaf, familyIndex, seriesIndex) => {
5353
return treeData.map((data, i) => {
5454
if (i === familyIndex) {
55-
if (seriesIndex < 0) {
55+
if (seriesIndex === undefined) {
5656
return leaf;
5757
} else {
5858
return {
@@ -91,6 +91,7 @@ export const Component = () => {
9191
useEffect(() => {
9292
if (selectedLeaf.node) {
9393
const { treeData, node, expanded, path } = selectedLeaf;
94+
9495
const isFamily = path.length === 1;
9596
const isSeries = path.length === 2;
9697

0 commit comments

Comments
 (0)