From ac57e2473d5771ed0104335c2a3d42674346310a Mon Sep 17 00:00:00 2001 From: Xc Date: Thu, 24 Apr 2025 15:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E4=B8=AA=E8=BE=B9=E7=95=8C=E6=B2=A1?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/features/runningTree.js | 6 ++++-- lib/features/runningTree.js | 6 ++++-- src/features/runningTree.ts | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/es/features/runningTree.js b/es/features/runningTree.js index 35fb2bcd..87c9af89 100644 --- a/es/features/runningTree.js +++ b/es/features/runningTree.js @@ -1923,11 +1923,13 @@ export class RunningTree extends Feature { createNode(options, isPage) { const { entity, pagination, path: fullPath, filters, sorters, projection, isList, id, getTotal, zombie, stale, } = options; const rollback = this.begin(); - this.redoBranchModis(fullPath); - this.redoBranchOperations(fullPath); let node; const { parent, path } = analyzePath(fullPath); const parentNode = parent ? this.findNode(parent) : undefined; + if (parentNode) { + this.redoBranchModis(fullPath); + this.redoBranchOperations(fullPath); + } node = this.findNode(fullPath); // 找到了之前的node,需要检查是否需要重用 if (node) { diff --git a/lib/features/runningTree.js b/lib/features/runningTree.js index a4fdd8d1..3ec83cff 100644 --- a/lib/features/runningTree.js +++ b/lib/features/runningTree.js @@ -1926,11 +1926,13 @@ class RunningTree extends Feature_1.Feature { createNode(options, isPage) { const { entity, pagination, path: fullPath, filters, sorters, projection, isList, id, getTotal, zombie, stale, } = options; const rollback = this.begin(); - this.redoBranchModis(fullPath); - this.redoBranchOperations(fullPath); let node; const { parent, path } = analyzePath(fullPath); const parentNode = parent ? this.findNode(parent) : undefined; + if (parentNode) { + this.redoBranchModis(fullPath); + this.redoBranchOperations(fullPath); + } node = this.findNode(fullPath); // 找到了之前的node,需要检查是否需要重用 if (node) { diff --git a/src/features/runningTree.ts b/src/features/runningTree.ts index 81c8e951..e5594bcb 100644 --- a/src/features/runningTree.ts +++ b/src/features/runningTree.ts @@ -2325,11 +2325,13 @@ export class RunningTree extends Feature stale, } = options; const rollback = this.begin(); - this.redoBranchModis(fullPath); - this.redoBranchOperations(fullPath); let node: ListNode | SingleNode | VirtualNode | undefined; const { parent, path } = analyzePath(fullPath); const parentNode = parent ? this.findNode(parent) : undefined; + if (parentNode) { + this.redoBranchModis(fullPath); + this.redoBranchOperations(fullPath); + } node = this.findNode(fullPath) as (ListNode | SingleNode | VirtualNode